summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston Sequoia <jeremyhu@apple.com>2016-05-29 14:01:38 -0700
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2016-09-16 11:49:12 -0700
commitfe53d94239adc8c302757fd8204a5b2c0c5a9850 (patch)
treee834743bcb46fcdd2c560d0f77e0bb00549c1a6d
parenta3922cf7f02feac88a80995cef5e843aafdd970b (diff)
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> (cherry picked from commit 33d595255d4206df0d136014de33100817cbe344)
-rw-r--r--hw/xquartz/X11Application.m9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index d2c5d3083..9a2290990 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -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 */