diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-03-05 16:22:10 +0100 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2012-03-07 20:33:12 +0100 |
commit | 3123a1107c3d78d4fb610a4753e7d7f7c4cb69d2 (patch) | |
tree | 29d0772bbd63de55d3e08dd20348868e207c04df | |
parent | 5b7985b92730db7e79ff91c4c74dfaa43f2ef9dc (diff) |
virt-viewer-window: Don't try to resize non visible windows
Trying to resize not visible windows leads to the following being printed
to the console:
Gdk-CRITICAL **: IA__gdk_window_get_origin: assertion `GDK_IS_WINDOW (window)'
This gets triggered by the gdk_screen_get_monitor_geometry() call in
virt_viewer_window_resize()
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r-- | src/virt-viewer-window.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c index f788193..1733211 100644 --- a/src/virt-viewer-window.c +++ b/src/virt-viewer-window.c @@ -106,6 +106,7 @@ struct _VirtViewerWindowPrivate { gboolean grabbed; gboolean before_saved; GdkRectangle before_fullscreen; + gboolean desktop_resize_pending; gint zoomlevel; gboolean auto_resize; @@ -323,6 +324,10 @@ static void virt_viewer_window_desktop_resize(VirtViewerDisplay *display G_GNUC_UNUSED, VirtViewerWindow *self) { + if (!gtk_widget_get_visible(self->priv->window)) { + self->priv->desktop_resize_pending = TRUE; + return; + } virt_viewer_window_resize(self); } @@ -960,6 +965,11 @@ void virt_viewer_window_show(VirtViewerWindow *self) { gtk_widget_show(self->priv->window); + + if (self->priv->desktop_resize_pending) { + virt_viewer_window_resize(self); + self->priv->desktop_resize_pending = FALSE; + } } void |