[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.
This commit is contained in:
@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user