summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2014-04-01 16:37:28 (GMT)
committerMarc-André Lureau <marcandre.lureau@gmail.com>2014-04-17 09:48:01 (GMT)
commit7e13de0c32ea2529a2d93a0493358bcd7408ada2 (patch)
tree12cc15e9dd169c27f88fd7945f90d63eb687c2bb
parent5ab6eb7b333fb4a440822b28b3b24652705638e3 (diff)
downloadvirt-viewer-master.zip
virt-viewer-master.tar.gz
virt-viewer-master.tar.xz
Fix race with metacity in fullscreenHEADmaster
To avoid some races with metacity, the window should be placed as early as possible, before it is (re)allocated & mapped (rhbz#809546).
-rw-r--r--src/virt-viewer-window.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index f310072..6f6f9a4 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -467,7 +467,7 @@ virt_viewer_window_move_to_monitor(VirtViewerWindow *self)
GdkRectangle mon;
gint n = priv->fullscreen_monitor;
- if (n == -1 || !priv->fullscreen)
+ if (n == -1)
return;
gdk_screen_get_monitor_geometry(gdk_screen_get_default(), n, &mon);
@@ -542,6 +542,12 @@ virt_viewer_window_enter_fullscreen(VirtViewerWindow *self, gint monitor)
priv->fullscreen = TRUE;
if (!gtk_widget_get_mapped(priv->window)) {
+ /*
+ * To avoid some races with metacity, the window should be placed
+ * as early as possible, before it is (re)allocated & mapped
+ * Position & size should not be queried yet. (rhbz#809546).
+ */
+ virt_viewer_window_move_to_monitor(self);
g_signal_connect(priv->window, "map-event", G_CALLBACK(mapped), self);
return;
}
@@ -1292,7 +1298,8 @@ virt_viewer_window_show(VirtViewerWindow *self)
if (self->priv->kiosk)
virt_viewer_window_enable_kiosk(self);
- virt_viewer_window_move_to_monitor(self);
+ if (self->priv->fullscreen)
+ virt_viewer_window_move_to_monitor(self);
}
void