[virt-tools-list] [PATCH 2/4] virt-viewer-window: Move checks before resize to virt_viewer_window_resize

Hans de Goede hdegoede at redhat.com
Mon Mar 5 15:22:08 UTC 2012


Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 src/virt-viewer-window.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index 604bc97..f86b5b7 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -323,9 +323,7 @@ static void
 virt_viewer_window_desktop_resize(VirtViewerDisplay *display G_GNUC_UNUSED,
                                   VirtViewerWindow *self)
 {
-    VirtViewerWindowPrivate *priv = self->priv;
-    if (priv->auto_resize && !priv->fullscreen)
-        virt_viewer_window_resize(self);
+    virt_viewer_window_resize(self);
 }
 
 
@@ -393,6 +391,9 @@ virt_viewer_window_resize(VirtViewerWindow *self)
     guint desktopHeight;
     VirtViewerWindowPrivate *priv = self->priv;
 
+    if (!priv->auto_resize || priv->fullscreen)
+        return;
+
     DEBUG_LOG("Preparing main window resize");
     if (!priv->display) {
         DEBUG_LOG("Skipping inactive resize");
@@ -679,8 +680,7 @@ virt_viewer_window_menu_view_resize(GtkWidget *menu,
 
     if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu))) {
         priv->auto_resize = TRUE;
-        if (!priv->fullscreen)
-            virt_viewer_window_resize(self);
+        virt_viewer_window_resize(self);
     } else {
         priv->auto_resize = FALSE;
     }
-- 
1.7.7.6




More information about the virt-tools-list mailing list