Eren Tantekin
Eren Tantekin

Reputation: 1471

I modified GTK source code and recompiled: No effect

In Ubuntu (Gnome) there is absolutely no way the change the mouse wheel scroll rate for GTK applications. It is hard-coded in GTK and determined by a "smart" algorithm which dynamically depends on the window size.

So I downloaded the source and found the function that returns the step value. I changed it to return a very small number first, and then 0 (to see if it has any affect at all).

I did

./configure
make
sudo make install

as instructed by GTK website.

It compiles with no problems (I have the libraries)

Bu then, I restart and it has absolutely no affect. My guess is Ubuntu is still using the original GTK it shipped with. What do you think is wrong here?

Upvotes: 1

Views: 349

Answers (3)

Matt Joiner
Matt Joiner

Reputation: 118600

Manipulation of LD_LIBRARY_PATH and/or placing the necessary library files in the correct folders will get your modified files loaded.

Also note the use of ldd will enable you to verify that your modified libraries will be loaded. Here's a sample showing what will be loaded if I invoke ls on my current machine:

matt@stanley:~/src/pydlnadms$ ldd `which ls`
    linux-vdso.so.1 =>  (0x00007fff7cdde000)
    libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f245e288000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f245e080000)
    libacl.so.1 => /lib/x86_64-linux-gnu/libacl.so.1 (0x00007f245de77000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f245dae3000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f245d8df000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f245e4ca000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f245d6c0000)
    libattr.so.1 => /lib/x86_64-linux-gnu/libattr.so.1 (0x00007f245d4bb000)

Install your modified GTK+ shared libraries, manipulate the environment correctly, and then verify with ldd that your changes will be active.

Upvotes: 1

geocar
geocar

Reputation: 9305

The good news is that Ubuntu (by way of Debian) has specific tools for this, for example:

sudo apt-get build-dep libgtk-3-0

will install everything you need to build libgtk-3.0, while:

apt-get source libgtk-3-0

will get you the source code you need. You can patch it how you like, and then build .deb files containing your patches that are otherwise (from your patches I mean) indistinguishable from the Ubuntu version using:

debuild

Happy hacking!

Upvotes: 2

Well, the GTK libraries used by Ubuntu are under /usr/lib but the one you did build and installed are under /usr/local/lib (because the implicit --prefix to configure is /usr/local not /usr).

Probably, by setting your LD_LIBRARY_PATH to look into /usr/local/lib before /usr/lib should help.

Upvotes: 5

Related Questions