diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-05-21 10:07:36 -0400 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-05-21 11:29:36 -0400 |
commit | 05419b8450346e0669533a6557a876e8110e2a6e (patch) | |
tree | 08fd2b40237920e060f793003dde6f8ad7ab9602 | |
parent | e215c07439e94c00aa07dc822622431d7699b292 (diff) | |
download | mutter-05419b8450346e0669533a6557a876e8110e2a6e.tar.gz |
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.
-rw-r--r-- | src/core/frame.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/frame.c b/src/core/frame.c index fdf55d3fe..2297b5813 100644 --- a/src/core/frame.c +++ b/src/core/frame.c @@ -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 |