[virt-tools-list] [PATCH 1/2] Avoid extra zoom-level property notifications

Jonathon Jongsma jjongsma at redhat.com
Wed Oct 9 14:53:57 UTC 2013


When setting a display's zoom level to the same level as the current setting,
return early so that we don't notify about a property change
---
 src/virt-viewer-display.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/virt-viewer-display.c b/src/virt-viewer-display.c
index efae385..b6ef018 100644
--- a/src/virt-viewer-display.c
+++ b/src/virt-viewer-display.c
@@ -581,6 +581,10 @@ void virt_viewer_display_set_zoom_level(VirtViewerDisplay *display,
         zoom = MIN_ZOOM_LEVEL;
     if (zoom > MAX_ZOOM_LEVEL)
         zoom = MAX_ZOOM_LEVEL;
+
+    if (priv->zoom_level == zoom)
+        return;
+
     priv->zoom_level = zoom;
 
     virt_viewer_display_queue_resize(display);
-- 
1.8.3.1




More information about the virt-tools-list mailing list