summaryrefslogtreecommitdiff
path: root/modules/input
diff options
context:
space:
mode:
authorTakuro Ashie <ashie@clear-code.com>2013-07-27 10:34:39 +0900
committerJohn Ralls <jralls@ceridwen.us>2013-07-27 14:26:22 -0700
commit20d0434b8cb3908ec05cef4d80b3c499ec449f52 (patch)
treeaadf63849ba29ed12e92af245577e12240d0317a /modules/input
parentb80625a42531d4ea6313c4fe40e693a04f05193e (diff)
downloadgtk+-20d0434b8cb3908ec05cef4d80b3c499ec449f52.tar.gz
imquartz: Fallback to slave IM context if no NSEvent exists.
When an application translates a key event and drop its native event before passing to imquartz, it can't recognize the NSEvent. On this case imquartz doesn't emit any signals such as "commit" signal so that the application doesn't insert any text. To avoid no response, at least imquartz should fallback to slave GtkIMContextSimple. https://bugzilla.gnome.org/show_bug.cgi?id=694273#c27 (cherry picked from commit c064e188943ad6bd79d8476a0f53e27bfddb4a1f)
Diffstat (limited to 'modules/input')
-rw-r--r--modules/input/imquartz.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/input/imquartz.c b/modules/input/imquartz.c
index 9788ad371f..61ad914945 100644
--- a/modules/input/imquartz.c
+++ b/modules/input/imquartz.c
@@ -137,9 +137,6 @@ quartz_filter_keypress (GtkIMContext *context,
GTK_NOTE (MISC, g_print ("quartz_filter_keypress\n"));
- if (event->type == GDK_KEY_RELEASE)
- return FALSE;
-
if (!qc->client_window)
return FALSE;
@@ -152,10 +149,16 @@ quartz_filter_keypress (GtkIMContext *context,
GTK_NOTE (MISC, g_print ("client_window: %p, win: %p, nsview: %p\n",
qc->client_window, win, nsview));
+ NSEvent *nsevent = gdk_quartz_event_get_nsevent ((GdkEvent *)event);
+ if (!nsevent)
+ return gtk_im_context_filter_keypress (qc->slave, event);
+
+ if (event->type == GDK_KEY_RELEASE)
+ return FALSE;
+
if (event->hardware_keycode == 55) /* Command */
return FALSE;
- NSEvent *nsevent = gdk_quartz_event_get_nsevent ((GdkEvent *)event);
NSEventType etype = [nsevent type];
if (etype == NSKeyDown)
[nsview keyDown: nsevent];