Reduce server grabs during window creation

Remove some obvious server grabs from the window creation codepath,
also ones that are taken at startup.

During startup, there is no need to grab: we install the event handlers
before querying for the already-existing windows, so there is no danger
that we will 'lose' some window. We might try to create a window twice
(if it comes back in the original query and then we get an event for it)
but the code is already protected against such conditions.

When windows are created later, we also do not need grabs, we just need
appropriate error checking as the window may be destroyed at any time
(or it may have already been destroyed).

The stack tracker is unaffected here - as it listens to CreateNotify and
DestroyNotify events and responds directly, the internal stack
representation will always be consistent even if the window goes away while
we are processing MapRequest or similar.

Now that there are no grabs we don't have to worry about explicitly calling
display_notify_window after grabs have been dropped. Fold that into
meta_window_new_shared().

https://bugzilla.gnome.org/show_bug.cgi?id=721345
This commit is contained in:
Daniel Drake
2013-12-30 13:01:28 -06:00
parent af46ef3b96
commit 577624adef
3 changed files with 12 additions and 35 deletions

View File

@ -825,8 +825,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)
@ -894,8 +892,6 @@ meta_display_open (void)
meta_idle_monitor_init_dbus ();
meta_display_ungrab (the_display);
/* Done opening new display */
the_display->display_opening = FALSE;