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 67066 - GDK_LOCK_MASK vs X Lock modifier
GDK_LOCK_MASK vs X Lock modifier
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
1.3.x
Other other
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2001-12-16 19:45 UTC by Matthias Clasen
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthias Clasen 2001-12-16 19:45:15 UTC
GdkModifierType has GDK_LOCK_MASK as the X Lock modifier.
Code in gdk/x11/gdkkeys-x11.c interprets it as Shift Lock:
      if ((state & GDK_SHIFT_MASK) &&
          (state & GDK_LOCK_MASK))
        shift_level = 0; /* shift disables shift lock */
      else if ((state & GDK_SHIFT_MASK) ||
               (state & GDK_LOCK_MASK))
        shift_level = 1;
      else
        shift_level = 0;
while section L6.6 of the ICCCM states that "the Lock modifier
should be interpreted as Caps Lock or Shift Lock according as the
keycodes in its controlling set inlude XK_Caps_Lock or XK_Shift_Lock."
Beware that I don't really have an idea what the difference
between Shift and Caps Lock is, so maybe I'm off base here...
Comment 1 Owen Taylor 2001-12-18 17:52:30 UTC
Chapter 12.7 of the Xlib manual explains the difference - 
Shift Lock acts as a locked down shift key, while Caps Lock
shifts only alphanumeric characters. Indeeded, this looks
like it is doing Shift Lock, which is most likely wrong
for almost any user; Caps Lock is the normal behavior.

So, yes, there is a bug here; if it was simply that we
always used the Caps Lock interpretation, I'd probably say
that was OK, since this is only fallback code for systems
without XKB and with XKB, this is all handled within 
XKB. 

But as it's always the Shift Lock interpretation.
it probably should be fixed. (I think you basically have
to do XConvertCase on the keysym and see if it makes a
difference to figure out whether Caps Lock applies or not.)
Comment 2 Owen Taylor 2002-01-17 21:08:33 UTC
Putting on 2.0.1, since this problem only occurs for non-Xkb,
which is relatively uncommon these days.
Comment 3 Matthias Clasen 2002-04-05 13:33:03 UTC
Move open bugs from milestones 2.0.[012] -- > 2.0.3, since 2.0.2 is already out.
Comment 4 Owen Taylor 2002-10-16 23:19:18 UTC
Patch in bug 93575
Comment 5 Owen Taylor 2002-10-18 19:33:17 UTC
Committed a fix. Not quite as much testing as I'd like
for a complex patch.

Wed Oct 16 18:25:24 2002  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkkeys-x11.c: Rewrite the handling of
        key translation for the non-XKB case to properly
        handle Shift_Lock, Caps_Lock, Num_Lock according
        to the Xlib spec. (#67066)