[virt-tools-list] [PATCH virt-viewer 10/19] Use virt_viewer_connect_object() for display

Marc-André Lureau marcandre.lureau at gmail.com
Mon Jul 16 16:57:45 UTC 2012


When display is released, detach signal automatically
---
 src/virt-viewer-app.c    |    4 ++--
 src/virt-viewer-window.c |   24 ++++++++++++------------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 758cfe9..e5c674a 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -658,8 +658,8 @@ virt_viewer_app_display_added(VirtViewerSession *session G_GNUC_UNUSED,
     }
 
     virt_viewer_window_set_display(window, display);
-    g_signal_connect(display, "notify::show-hint",
-                     G_CALLBACK(display_show_hint), window);
+    virt_viewer_signal_connect_object(display, "notify::show-hint",
+                                      G_CALLBACK(display_show_hint), window, 0);
     g_object_notify(G_OBJECT(display), "show-hint"); /* call display_show_hint */
 }
 
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index 4887e28..3f7cbbe 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -1042,18 +1042,18 @@ virt_viewer_window_set_display(VirtViewerWindow *self, VirtViewerDisplay *displa
         gtk_notebook_append_page(GTK_NOTEBOOK(priv->notebook), GTK_WIDGET(display), NULL);
         gtk_widget_show_all(GTK_WIDGET(display));
 
-        g_signal_connect(display, "display-pointer-grab",
-                         G_CALLBACK(virt_viewer_window_pointer_grab), self);
-        g_signal_connect(display, "display-pointer-ungrab",
-                         G_CALLBACK(virt_viewer_window_pointer_ungrab), self);
-        g_signal_connect(display, "display-keyboard-grab",
-                         G_CALLBACK(virt_viewer_window_keyboard_grab), self);
-        g_signal_connect(display, "display-keyboard-ungrab",
-                         G_CALLBACK(virt_viewer_window_keyboard_ungrab), self);
-        g_signal_connect(display, "display-desktop-resize",
-                         G_CALLBACK(virt_viewer_window_desktop_resize), self);
-        g_signal_connect(display, "notify::show-hint",
-                         G_CALLBACK(display_show_hint), self);
+        virt_viewer_signal_connect_object(display, "display-pointer-grab",
+                                          G_CALLBACK(virt_viewer_window_pointer_grab), self, 0);
+        virt_viewer_signal_connect_object(display, "display-pointer-ungrab",
+                                          G_CALLBACK(virt_viewer_window_pointer_ungrab), self, 0);
+        virt_viewer_signal_connect_object(display, "display-keyboard-grab",
+                                          G_CALLBACK(virt_viewer_window_keyboard_grab), self, 0);
+        virt_viewer_signal_connect_object(display, "display-keyboard-ungrab",
+                                          G_CALLBACK(virt_viewer_window_keyboard_ungrab), self, 0);
+        virt_viewer_signal_connect_object(display, "display-desktop-resize",
+                                          G_CALLBACK(virt_viewer_window_desktop_resize), self, 0);
+        virt_viewer_signal_connect_object(display, "notify::show-hint",
+                                          G_CALLBACK(display_show_hint), self, 0);
     }
 }
 
-- 
1.7.10.4




More information about the virt-tools-list mailing list