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 711f0c0c50
commit 34979c3fe8

View File

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