thesquash / gtk3-classic-module

A GTK module to restore classic behaviours and appearances to GTK 3
Other
1 stars 1 forks source link

atril still uses automnemonics even with gtk-auto-mnemonics=0 #1

Closed bgstack15 closed 1 week ago

bgstack15 commented 2 weeks ago

Problem: When I use gtk3-classic-module compiled and installed as a deb, atril still needs ALT pressed for the 300ms before showing the underlines on the menu entries. What is weird is Firefox shows the underlines all the time. OS and level: Devuan Ceres Atril version 1.26.2

$ ldd $( which atril ) | grep gtk        
        libgtk3-nocsd.so.0 => /lib/x86_64-linux-gnu/libgtk3-nocsd.so.0 (0x00007fa030572000)
    libgtk-3.so.0 => /lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007fa02fa00000)
    libwebkit2gtk-4.1.so.0 => /lib/x86_64-linux-gnu/libwebkit2gtk-4.1.so.0 (0x00007fa02a400000)
    libjavascriptcoregtk-4.1.so.0 => /lib/x86_64-linux-gnu/libjavascriptcoregtk-4.1.so.0 (0x00007fa027a00000)
$ dpkg -l | grep libgtk-3-bin
ii  libgtk-3-bin                                                3.24.43-4                                               amd64        programs for the GTK graphical user interface library
$ find $( dpkg -L gtk3-classic-module ) -maxdepth 0 ! -type d
/etc/gtk-3.0/settings.ini
/usr/lib/x86_64-linux-gnu/gtk-3.0/modules/libgtk3-classic-module.so
/usr/share/doc/gtk3-classic-module/README.Debian
/usr/share/doc/gtk3-classic-module/changelog.Debian.gz
/usr/share/doc/gtk3-classic-module/copyright
/usr/share/glib-2.0/schemas/00_gtk3-classic-module.gschema.override

When I use package gtk3-automnemonics (compiled from the https://github.com/thesquash/sgm repository), atrli works correctly.

$ find $( dpkg -L gtk3-automnemonics ) -maxdepth 0 ! -type d
/etc/X11/Xsession.d/53gtk3-automnemonics
/usr/lib/x86_64-linux-gnu/gtk-3.0/modules/libsgm-flexible-mnemonics.so

What am I doing wrong? I have the /etc/gtk-3.0/settings.ini file as laid down by this project, and I tried running with this but it did not help:

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/gtk-3.0/modules/libgtk3-classic-module.so atril
thesquash commented 1 week ago

LD_PRELOAD is definitely the wrong way to use this module.

Have you tried:

GTK_MODULES='gtk3-classic-module' atril

If that works, then your ~/.config/gtk-3.0/settings.ini file contains a gtk-modules line which is overriding the line in the file /etc/gtk-3.0/settings.ini file installed by the module. Append 'gtk3-classic-moduleto yoursettings.inifile or yourGTK_MODULES` variable if this is the case.

bgstack15 commented 1 week ago

My ~/.config/gtk-3.0/settings.ini file contained this entry, which I have now removed entirely from the file:

gtk-modules = sgm-flexible-mnemonics

That sgm-flexible-mnemonics is from that sgm repository. After removing it, and even adding export GTK_MODULES=gtk3-classic-module to ~/.bashrc, and logging out and back in, my atril still does not show the always-on underlines. (Why does GTK_MODULES get used here, and not that GTK3_MODULES which was previously used?)

If I open a terminal window and then run atril, then the underlines are always there.

I have learned that by inserting export GTK_MODULES="${GTK_MODULES:+${GTK_MODULES}:}gtk3-classic-module" to my ~/.fluxbox/startup my environment then will let atril have the underlines like it is supposed to have. I'm surprised the /etc/gtk-3.0/settings.ini file is not loaded or read, but I can live with setting another environment variable to accomplish this! Thank you very much.

You can close this.

bgstack15 commented 1 week ago

I think adopting the approach used by sgm for setting the environment variable is the way to go here. When I package this up, I'll contribute this file:

# File: /etc/X11/Xsession.d/54gtk3-classic-module
# Placed by package gtk3-classic-module
_add="gtk3-classic-module"
if [ -z "$GTK_MODULES" ] ; then
    GTK_MODULES="${_add}"
else
    GTK_MODULES="$GTK_MODULES:${_add}"
fi
export GTK_MODULES