Commit ee0e59e6 authored by John Ralls's avatar John Ralls

[IMQuartz] Get the GdkWindow from the NSKeyEvent.

Instead of from the IMContextQuartz's client window because the former
is the event window where the text will be inserted. In some cases
they're different and the text may be discarded (because the client
window isn't editable) or misplaced.

Fixes Bug 707945.
parent 3c49c593
Pipeline #51060 passed with stage
in 6 minutes and 11 seconds
......@@ -190,11 +190,6 @@ quartz_filter_keypress (GtkIMContext *context,
if (!GDK_IS_QUARTZ_WINDOW (qc->client_window))
return FALSE;
nsview = gdk_quartz_window_get_nsview (qc->client_window);
win = (GdkWindow *)[ (GdkQuartzView *)nsview gdkWindow];
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)
......@@ -206,6 +201,12 @@ quartz_filter_keypress (GtkIMContext *context,
return gtk_im_context_filter_keypress (qc->slave, event);
}
nsview = gdk_quartz_window_get_nsview (qc->client_window);
win = (GdkWindow *)[(GdkQuartzView *)[[nsevent window] contentView] gdkWindow];
GTK_NOTE (MISC, g_print ("client_window: %p, win: %p, nsview: %p\n",
qc->client_window, win, nsview));
if (event->type == GDK_KEY_RELEASE)
return FALSE;
......
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