frame: Make sure to XSync before grabbing keybindings

Otherwise, the X server might read the backend's connection before
GTK+'s, meaning that it sees the XIGrabKeycode requests before the
CreateWindow.

This fixes keybindings on windows not working immediately.

Thanks to Rui Matos <tiagomatos@gmail.com> and
Julien Cristau <jcristau@debian.org> for helping track down the issue.
This commit is contained in:
Jasper St. Pierre 2014-05-21 10:07:36 -04:00
parent e215c07439
commit 05419b8450

View File

@ -151,10 +151,15 @@ meta_window_ensure_frame (MetaWindow *window)
window->frame->xwindow,
window->title);
meta_ui_map_frame (frame->window->screen->ui, frame->xwindow);
/* Since the backend takes keygrabs on another connection, make sure
* to sync the GTK+ connection to ensure that the frame window has
* been created on the server at this point. */
XSync (window->display->xdisplay, False);
/* Move keybindings to frame instead of window */
meta_window_grab_keys (window);
meta_ui_map_frame (frame->window->screen->ui, frame->xwindow);
}
void