[virt-tools-list] [PATCH virt-viewer 2/2] virt-viewer-window: Set initial zoom only once

Pavel Grunt pgrunt at redhat.com
Tue Apr 21 18:48:43 UTC 2015


It is not needed to do it more times as it may cause unnecessary resize
events especially when leaving the fullscreen mode

related: rhbz#1206460
---
 src/virt-viewer-window.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index 3820159..73c19e7 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -110,6 +110,7 @@ struct _VirtViewerWindowPrivate {
     gint zoomlevel;
     gboolean fullscreen;
     gchar *subtitle;
+    gboolean initial_zoom_set;
 };
 
 static void
@@ -1281,7 +1282,8 @@ display_show_hint(VirtViewerDisplay *display,
 
     hint = (hint & VIRT_VIEWER_DISPLAY_SHOW_HINT_READY);
 
-    if (hint && virt_viewer_display_get_enabled(display)) {
+    if (!self->priv->initial_zoom_set && hint && virt_viewer_display_get_enabled(display)) {
+        self->priv->initial_zoom_set = TRUE;
         virt_viewer_window_set_zoom_level(self, self->priv->zoomlevel);
     }
 
-- 
2.3.5




More information about the virt-tools-list mailing list