[virt-tools-list] [PATCH virt-viewer] Fix race with metacity in fullscreen

Jonathon Jongsma jjongsma at redhat.com
Mon Apr 21 20:50:40 UTC 2014


Looks safe, so if it fixes the issue, ACK.

----- Original Message -----
> From: "Marc-André Lureau" <marcandre.lureau at gmail.com>
> To: "virt" <virt-tools-list at redhat.com>
> Sent: Thursday, April 17, 2014 4:48:22 AM
> Subject: Re: [virt-tools-list] [PATCH virt-viewer] Fix race with metacity in	fullscreen
> 
> ping
> 
> 
> On Tue, Apr 1, 2014 at 6:44 PM, Marc-André Lureau <
> marcandre.lureau at gmail.com > wrote:
> 
> 
> To avoid some races with metacity, the window should be placed as
> early as possible, before it is (re)allocated & mapped (rhbz#809546).
> ---
> src/virt-viewer-window.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
> index f310072..e1b27ff 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->fullscreen)
> + virt_viewer_window_move_to_monitor(self);
> }
> 
> void
> --
> 1.8.5.3
> 
> 
> 
> 
> --
> Marc-André Lureau
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list




More information about the virt-tools-list mailing list