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 645341 - pre dialog set CAPSLOCK is ignored.
pre dialog set CAPSLOCK is ignored.
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
3.0.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-03-20 23:08 UTC by Koop Mast (kwm)
Modified: 2011-04-03 21:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (3.75 KB, patch)
2011-04-02 22:41 UTC, Matthias Clasen
none Details | Review
slightly improved (3.75 KB, patch)
2011-04-02 23:40 UTC, Matthias Clasen
none Details | Review

Description Koop Mast (kwm) 2011-03-20 23:08:18 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.
Comment 1 Allison Karlitskaya (desrt) 2011-04-02 14:51:40 UTC
Here too.
Comment 2 Allison Karlitskaya (desrt) 2011-04-02 15:54:32 UTC
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;
}
Comment 3 Matthias Clasen 2011-04-02 18:04:12 UTC
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)
Comment 4 Matthias Clasen 2011-04-02 22:41:29 UTC
Created attachment 184995 [details] [review]
patch
Comment 5 Matthias Clasen 2011-04-02 23:40:56 UTC
Created attachment 184996 [details] [review]
slightly improved

The second patch is slightly better, it should get the initial numlock state right.