GNOME Bugzilla – Bug 645341
pre dialog set CAPSLOCK is ignored.
Last modified: 2011-04-03 21:39:33 UTC
When the unlock dialog is active and the Caps Lock key is toggled, Text below the password box appears saying that Caps Lock is on. This text doesn't appear when Caps Lock is toggled before the dialog is shown. This lead to some frustrating minutes trying to figure out why it didn't want to unlock.
Here too.
I dug into the gnome-screensaver code and was able to produce a test case that demonstrates that the problem lies in Gtk, not gnome-screensaver: #include <gtk/gtk.h> static gboolean show_status (gpointer user_data) { GdkKeymap *keymap; keymap = gdk_keymap_get_default (); g_print ("caps: %d, num: %d\n", gdk_keymap_get_caps_lock_state (keymap), gdk_keymap_get_num_lock_state (keymap)); return TRUE; } int main (void) { gtk_init (NULL, NULL); g_timeout_add (1000, show_status, NULL); gtk_main (); return 0; }
I think we may need to sprinkle if (KEYMAP_USE_XKB (keymap)) get_xkb (keymap_x11); In some of the getters (and call update_lock_state initially)
Created attachment 184995 [details] [review] patch
Created attachment 184996 [details] [review] slightly improved The second patch is slightly better, it should get the initial numlock state right.