window: Don't try to map / unmap OR windows by ourselves

This is bad behavior, and can also cause us to get in an infinite loop
if an OR window is mapped and unmapped in quick succession. This
sequence causes a MapNotify followed by an UnmapNotify, and when
processing the events, we'll call XMapWindow, XUnmapWindow, which will
put another set of MapNotify, UnmapNotify events in our queue, which we
then process by calling XMapWindow, XUnmapWindow, and so it goes
forever, or at least some scheduler uncorks us by making us call
XMapWindow when the window is already mapped, or XUnmapWindow when the
window is already unmapped.

We can stop this madness by simply making sure never to call neither
XMapWindow or XUnmapWindow on OR windows, which is the correct thing to
do anyway.
This commit is contained in:
Jasper St. Pierre 2014-08-19 15:57:52 -04:00
parent 170ff5e2e8
commit 31afdd4deb

View File

@ -823,6 +823,8 @@ sync_client_window_mapped (MetaWindow *window)
{
gboolean should_be_mapped = client_window_should_be_mapped (window);
g_return_if_fail (!window->override_redirect);
if (window->mapped == should_be_mapped)
return;
@ -1487,6 +1489,7 @@ meta_window_new (MetaDisplay *display,
/* disable show desktop mode unless we're a desktop component */
maybe_leave_show_desktop_mode (window);
if (!window->override_redirect)
sync_client_window_mapped (window);
meta_window_queue (window, META_QUEUE_CALC_SHOWING);
@ -2291,6 +2294,7 @@ implement_showing (MetaWindow *window,
meta_verbose ("Implement showing = %d for window %s\n",
showing, window->desc);
if (!window->override_redirect)
sync_client_window_mapped (window);
if (!showing)