XQuartz: Fix the issue where the h key could be come "stuck" after hiding XQuartz with cmd-h

The issue was that we set a flag to ignore the k key's up event when sent
the cmd-h down event, but because the cmd-h keycode hides XQuartz, we
became !_x_active by the time the event is delivered which caused us to
go down a differnet codepath rather than getting a chance to ignore it.
We then incorrectly ignored the next h up key.

https://bugs.freedesktop.org/show_bug.cgi?id=92648

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
This commit is contained in:
Jeremy Huddleston Sequoia 2016-05-29 14:01:38 -07:00
parent d8e05c0475
commit 33d595255d

View File

@ -366,6 +366,15 @@ message_kit_thread(SEL selector, NSObject *arg)
else {
/* No kit window is focused, so send it to X. */
for_appkit = NO;
/* Reset our swallow state if we're seeing the same keyCode again.
* This can happen if we become !_x_active when the keyCode we
* intended to swallow is delivered. See:
* https://bugs.freedesktop.org/show_bug.cgi?id=92648
*/
if ([e keyCode] == swallow_keycode) {
do_swallow = NO;
}
}
}
else { /* KeyUp */