Comment 6 for bug 943194

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I have spent all day on this and it seems we have a choice of either:
  (a) Tap detection for the Alt key working (as it does now), and no KeyPress event for "Alt" reaching other apps until Alt+other_key is pressed; or
  (b) Tap detection not working, and the Alt KeyPress event reaching other apps immediately.

Technically, the issue seems to be that it is impossible to replay the initial Alt press to the app, either because that is under a passive grab and you can't replay passively grabbed key events, or because it's an xbkEvent (not an XKeyEvent). You can however choose to ignore such events with XUngrabKeyboard, but that completely breaks tap detection (removing the synchronous grab).

I have two suggestions:

1. To retain tapping and keep compiz how it is ((a)), and modify the existing Alt key Initiate callback in Unity to send a signal to the panel to show the menu when Alt has been held down for a second or so. The same as the Launcher already does when Super is held down to show the shortcuts. Sorry I don't have a Unity-5 dev environment to do this right now. But it should be simple in theory.

2. Alternatively, we could disable the Alt-only keybinding for now as mentioned in comment #4. That would not only solve this bug but also bug 943851, bug 943456 and bug 943223.

Theoretically, another solution to most of these Alt bugs is to rewrite the compiz tap detection using passive grabs. However, I have tried that several times over the past month and tried again today. Still couldn't get that approach working.