diff options
author | John Ralls <jralls@ceridwen.us> | 2019-01-13 15:55:51 -0800 |
---|---|---|
committer | John Ralls <jralls@ceridwen.us> | 2019-01-13 16:00:53 -0800 |
commit | ee0e59e6cf18d2a70bd5398189340eea74989753 (patch) | |
tree | b38314608710f69435ba74af1f447d9fae825e9c | |
parent | 3c49c593f57d0153fea0c191f502addfbd8a6f61 (diff) | |
download | gtk+-ee0e59e6cf18d2a70bd5398189340eea74989753.tar.gz |
[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.
-rw-r--r-- | modules/input/imquartz.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/modules/input/imquartz.c b/modules/input/imquartz.c index 46ceafe194..bc2d895775 100644 --- a/modules/input/imquartz.c +++ b/modules/input/imquartz.c @@ -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; |