[virt-tools-list] [PATCH virt-viewer 1/2] Emit one show-hint notification when enabling a display

Jonathon Jongsma jjongsma at redhat.com
Wed Apr 8 21:41:04 UTC 2015


Freeze notifications before setting the show hints to prevent multiple
notification signals from being emitted.
---
 src/virt-viewer-display.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/virt-viewer-display.c b/src/virt-viewer-display.c
index 66429f1..2b30567 100644
--- a/src/virt-viewer-display.c
+++ b/src/virt-viewer-display.c
@@ -686,9 +686,12 @@ void virt_viewer_display_set_enabled(VirtViewerDisplay *self, gboolean enabled)
 {
     g_return_if_fail(VIRT_VIEWER_IS_DISPLAY(self));
 
-    virt_viewer_display_set_show_hint(self, VIRT_VIEWER_DISPLAY_SHOW_HINT_SET, TRUE);
+    g_object_freeze_notify(G_OBJECT(self));
 
+    virt_viewer_display_set_show_hint(self, VIRT_VIEWER_DISPLAY_SHOW_HINT_SET, TRUE);
     virt_viewer_display_set_show_hint(self, VIRT_VIEWER_DISPLAY_SHOW_HINT_DISABLED, !enabled);
+
+    g_object_thaw_notify(G_OBJECT(self));
 }
 
 gboolean virt_viewer_display_get_enabled(VirtViewerDisplay *self)
-- 
2.1.0




More information about the virt-tools-list mailing list