XIM: Don't force random windows to become native
GDK_WINDOW_XID() has the side-effect of turning a window native; this in turn can have unexpected effects such as black backgrounds. Avoid this by using the XID of the toplevel. https://bugzilla.gnome.org/show_bug.cgi?id=682395
This commit is contained in:
parent
307a1dc638
commit
d6809d050a
@ -697,18 +697,21 @@ gtk_im_context_xim_filter_keypress (GtkIMContext *context,
|
|||||||
KeySym keysym;
|
KeySym keysym;
|
||||||
Status status;
|
Status status;
|
||||||
gboolean result = FALSE;
|
gboolean result = FALSE;
|
||||||
GdkWindow *root_window = gdk_screen_get_root_window (gdk_window_get_screen (event->window));
|
GdkWindow *root_window;
|
||||||
|
GdkWindow *window;
|
||||||
XKeyPressedEvent xevent;
|
XKeyPressedEvent xevent;
|
||||||
|
|
||||||
if (event->type == GDK_KEY_RELEASE && !context_xim->filter_key_release)
|
if (event->type == GDK_KEY_RELEASE && !context_xim->filter_key_release)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
root_window = gdk_screen_get_root_window (gdk_window_get_screen (event->window));
|
||||||
|
window = gdk_window_get_toplevel (event->window);
|
||||||
|
|
||||||
xevent.type = (event->type == GDK_KEY_PRESS) ? KeyPress : KeyRelease;
|
xevent.type = (event->type == GDK_KEY_PRESS) ? KeyPress : KeyRelease;
|
||||||
xevent.serial = 0; /* hope it doesn't matter */
|
xevent.serial = 0; /* hope it doesn't matter */
|
||||||
xevent.send_event = event->send_event;
|
xevent.send_event = event->send_event;
|
||||||
xevent.display = GDK_WINDOW_XDISPLAY (event->window);
|
xevent.display = GDK_WINDOW_XDISPLAY (window);
|
||||||
xevent.window = GDK_WINDOW_XID (event->window);
|
xevent.window = GDK_WINDOW_XID (window);
|
||||||
xevent.root = GDK_WINDOW_XID (root_window);
|
xevent.root = GDK_WINDOW_XID (root_window);
|
||||||
xevent.subwindow = xevent.window;
|
xevent.subwindow = xevent.window;
|
||||||
xevent.time = event->time;
|
xevent.time = event->time;
|
||||||
|
Loading…
Reference in New Issue
Block a user