Commit c064e188 authored by Takuro Ashie's avatar Takuro Ashie Committed by John Ralls

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.
parent 71b73e04
......@@ -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];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment