diff --git a/src/core/display.c b/src/core/display.c index b37bd73c7..f0301c46e 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -925,8 +925,6 @@ meta_display_open (void) enable_compositor (the_display); - meta_display_grab (the_display); - /* Now manage all existing windows */ tmp = the_display->screens; while (tmp != NULL) @@ -978,8 +976,6 @@ meta_display_open (void) meta_idle_monitor_init_dbus (); - meta_display_ungrab (the_display); - /* Done opening new display */ the_display->display_opening = FALSE; diff --git a/src/core/screen.c b/src/core/screen.c index 0bfe2d9d7..6ba2e68c7 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -884,8 +884,6 @@ meta_screen_manage_all_windows (MetaScreen *screen) Window *children; int n_children, i; - meta_display_grab (screen->display); - if (screen->guard_window == None) screen->guard_window = create_guard_window (screen->display->xdisplay, screen); @@ -904,8 +902,6 @@ meta_screen_manage_all_windows (MetaScreen *screen) g_free (children); meta_stack_thaw (screen->stack); - - meta_display_ungrab (screen->display); } /** diff --git a/src/core/window.c b/src/core/window.c index 4efd00330..d6c3f253c 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -792,11 +792,14 @@ meta_window_new (MetaDisplay *display, return NULL; } - /* Grab server */ - meta_display_grab (display); meta_error_trap_push (display); /* Push a trap over all of window * creation, to reduce XSync() calls */ + /* + * This function executes without any server grabs held. This means that + * the window could have already gone away, or could go away at any point, + * so we must be careful with X error handling. + */ if (!XGetWindowAttributes (display->xdisplay, xwindow, &attrs)) { @@ -1434,7 +1437,6 @@ meta_window_new (MetaDisplay *display, unminimize_window_and_all_transient_parents (window); meta_error_trap_pop (display); /* pop the XSync()-reducing trap */ - meta_display_ungrab (display); window->constructing = FALSE; @@ -1450,7 +1452,6 @@ meta_window_new (MetaDisplay *display, error: meta_error_trap_pop (display); - meta_display_ungrab (display); return NULL; }