With PC X server, indicator-applet grabs "M" key for "Mail" action

Bug #583900 reported by Dave Kriewall
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
indicator-applet (Ubuntu)
Invalid
Low
Unassigned

Bug Description

Using a PC-based X server, such as Attachmate Reflection, the two keys "s" and "m" cannot be typed into an application on ubuntu 10.04 LTS desktop edition. The "s" key always brings up the "shutdown" menu, and the "m" key always brings up the "mail" menu.

Steps to reproduce:
1) Install ubuntu 10.04.
2) apt-get install openssh
3) using PC X server, start gnome-session via ssh
4) bring up a gnome-terminal
5) type "emacs"

Expected result: brings up the emacs editor.
Acutal result: "e" gets displayed in the terminal, then the mail menu comes up.

Troubleshooting:

There are several problems, which only someone with access to and understanding of source code can probably answer.

1) The reason 'm' does not type 'm' is that the Indicator Applet has issued several GrabKey (X protocol) requests, one of which grabs the key corresponding to keysym 'm' with no modifiers (i.e., not shift-M or control-m -- just plain 'm'). Indicator Applet previously reads the X keyboard map and modifier map. The keyboard map does not contain a KeySym for "XF86Mail" which is the keyboard shortcut associated with Desktop "Launch email client". It is a mystery therefore why Indicator Applet would grab an alphanumeric key like "m" with no modifiers (control, meta, etc.) set. It doesn't matter where the "m" keysym is in the keyboard map; Indicator Applet finds it and grabs the keycode generated by "m".

The net effect of this is that it becomes impossible to type the letter "m" in any other application (e.g. typing "emacs" in a console); the "m" is grabbed (intercepted) by the indicator-applet.

I would have expected that Indicator Applet would obtain the keyboard shortcut associated with Desktop..Launch email client (in this case, 'XF86Mail'), search the keymap for the corresponding shortkey keySym, and grab only the key (keycode) that corresponds to that keyboard shortcut. If not found in the keyboard map, the Indicator Applet should not grab any key at all (for that function). In other words, it looks like a bug in Indicator Applet.

2) Before Indicator Applet does this, another X client previously attempts to remap the keyboard with bogus values. Possibly this X client is xmodmap which is running as part of a login script. The keyboard remapping is blocked by a setting in the PC X server; if allowed, the keyboard map would be corrupted, since various modifier keys like Shift and Control are moved around but the modifier map is never changed to point to their new locations. This client is blindly setting a keyboard map, but even so it is not attempting to map the XF86Mail KeySym anywhere in its updated map. Since this is a PC keyboard with no special "mail" key on it, and no special steps have been taken on this machine to map a key to "XF86Mail", it is not surprising that the client doesn't attempt to map it. But the client should not be blindly setting the keyboard map on a remote X server (especially when doing so incorrectly and not updating the modifier map).

I am guessing that xmodmap is simply stuffing a keyboard map that works with the console to the attached X server, but this is only valid if the X server is indeed the console. There should be some way for the login script (or whatever is running the xmodmap) to detect that the attached device is not the console, and refrain from corrupting the keyboard map.

Additional information:

Under Keyboard Preferences, Layout is set to "US 105-key keyboard (with windows keys)". It is the only keyboard layout available. Keyboard model is "Generic Keyboard." I see no obvious way to prevent the anonymous client from trying to remap the keyboard.

I have an X protocol trace (taken with Reflection, the PC X server being used) that shows the behavior of these clients, if that would be of any use.

Killing the indicator-applet process eliminates the grab, and the 'm' key works properly.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the bug report. This particular bug has already been reported, but feel free to report any other bugs you find.

Changed in indicator-applet (Ubuntu):
importance: Undecided → Low
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.