Do

Comment 2 for bug 242221

Revision history for this message
codesnik (aronaxis) wrote :

just try it.

"system" > "preferences" > "keyboard" > "layouts"

press "add" and add, say, "french" to the list.

now check "separate layouts for each window"
and click on radiobutton near "USA" layout, so it'll become default.

now add "Keyboard indicator" applet to main gnome panel, just to monitor what's going on. you can switch layouts clicking with mouse on that applet for test purposes, assigning a hotkey for this isn't trivial.

in that mode each window remembers it's own state of keyboard layout, and this is very handy. I start an application, and switch a layout in it only once: I chat mostly in russian, but programming and shell is in english. When I alt-tab between windows, layout is switched according to what was last one for that window.

now you can assume that when launching new windows, they would have a "default" layout preselected. Unfortunatelly, this isn't true in Gnome. newly opened windows, even if they are from other applications, "inherits" _current_ layout. A little misconception in Gnome.
This is of a little annoyance in long running apps, but when using GnomeDo, opening and closing window so often, and typing bursts of keystrokes.. it become frustrating.

so basically fix for that would be
a) check that system has more than one layout, and "/desktop/gnome/peripherals/keyboard/general/groupPerWindow" in gconf is true
b) either remember last layout state on gnomd-do close/applaunch/etc, or (better) just checkout

"/desktop/gnome/peripherals/keyboard/kbd/layouts" array (comma separated string?) and on gnome-do window open event switch to layout, identified by "/desktop/gnome/peripherals/keyboard/general/defaultGroup" number, or 0 if it's not defined,

such a launcher should be usable without checking what is current layout - just a burst of keypresses in a blink of eye and you're done.