After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 652725 - please add GTK+ 3 Key Theme switcher
please add GTK+ 3 Key Theme switcher
Status: RESOLVED FIXED
Product: gnome-tweak-tool
Classification: Applications
Component: general
3.0.x
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME Tweak Tool maintainer(s)
GNOME Tweak Tool maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-06-16 12:48 UTC by Jamie
Modified: 2011-06-19 21:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add a gtk+ keybinding switcher (1.40 KB, patch)
2011-06-16 12:48 UTC, Jamie
none Details | Review

Description Jamie 2011-06-16 12:48:35 UTC
Created attachment 190038 [details] [review]
add a gtk+ keybinding switcher

Please add a GTK+ 3 Key Theme switcher.  It'd be a dead simple addition, infact, I added it myself in a couple of minutes just as a quick test.

It would probably be better though if the label explicitly said Gtk+ _3_ Keybinding Theme, so folks didn't get confused when it fails to work with GTK+ 2 apps (though they probably will anyway...).
Comment 1 John Stowers 2011-06-17 05:13:55 UTC
Quoting from an LWN comment so this is not lost -

> it sounds like you have a mix of gtk2 and gtk3 apps (which at this point is 
> going to be expected... all the commonly used gtk browsers still use gtk2 
> afaik) which means you'll need to set up the configs for both to get consistent 
> keybindings.
> 
> 
> 
> as I mentioned earlier GTK+ 3 emacs keybindings can be had with:
> 
> [Settings]
> gtk-key-theme-name = Emacs
> 
> in your ~/.config/gtk-3.0/settings.ini
> 
> while GTK+ 2 emacs keybindings can be had with:
> 
> include "/usr/share/themes/Emacs/gtk-2.0-key/gtkrc"
> 
> in your ~/.gtkrc-2.0 file (that's the path Debian uses, ymmv). Maybe your 
> distro prematurely removed, or moved the gtk2 central rc files? I'm gonna 
> install rawhide in a virtual sandbox to see how all this stuff fits together 
> there.
Comment 2 John Stowers 2011-06-17 05:17:27 UTC
(In reply to comment #0)
> Created an attachment (id=190038) [details] [review]
> add a gtk+ keybinding switcher
> 
> Please add a GTK+ 3 Key Theme switcher.  It'd be a dead simple addition,
> infact, I added it myself in a couple of minutes just as a quick test.
> 
> It would probably be better though if the label explicitly said Gtk+ _3_
> Keybinding Theme, so folks didn't get confused when it fails to work with GTK+
> 2 apps (though they probably will anyway...).

So gtk3 can get the keybinding from gsettings in addition to, or in preference of 
~/.config/gtk-3.0/settings.ini ?

To the best of your knowledge, is the only way to enable similar functionality for gtk-2 via editing ~/.gtkrc-2.0

In other places gnome-tweak-tool tries to keep gtk2/3 consistent, such as by offering themes that only support both
Comment 3 Jamie 2011-06-17 11:24:33 UTC
Hmmm, well, the truth is that I didn't test it going in the other direction once I finally realized I *had* to interact with the Xsettings manager when running Gnome 3 because the ini files were being ignored.  To be fair, the GTK+ documentation actually said as much.

quoting from:
http://developer.gnome.org/gtk3/3.0/GtkSettings.html#GtkSettings.description

"In the absence of an Xsettings manager, GTK+ reads default values for settings from settings.ini files in /etc/gtk-3.0 and $XDG_CONFIG_HOME/gtk-3.0."

GtkSettings documentation in GTK+ 2 said something similar, but I *swear* it let me override the behavior with ~/.gtkrc-2.0 even with a Xsettings manager present yesterday when I was testing.  Naturally, now I can't reproduce that ... (/me bangs head into desk for a while) ... unless I create a completely new user, in which case the ~/.gtkrc-2.0 file is honored right up until I ... eh, I'm not gonna keep playing this game.  I don't care, I don't even use gnome myself.

Point is, after some testing in Gnome 3 on Fedora 15, its clear that setting the /org/gnome/desktop/interface/gtk-key-theme key will affect both GTK+ 2 and 3.  So in my patch the KeyThemeSwitcher class should amended to be similar to the GtkThemeSwitcher class, probably just tacking on 

"and os.path.isfile(os.path.join(d, "gtk-2.0-key", "gtkrc"))"

to the lambda in _get_valid_key_themes, which should give you the consistency you're looking for and eliminate the need to be explicit about the gtk version in the label (ignoring gtk 1 apps, which are pretty much all bitrot at this point anyway).
Comment 4 John Stowers 2011-06-19 21:59:32 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.