[PATCHv3 virt-viewer 03/12] Return existing window in app_window_new()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since the returned window is weak, it can already returns existing
windows (instead of creating one and failing to insert).

This allows the following set_kiosk() function to create a main window
before the app constructor is called.
---
 src/virt-viewer-app.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 06a443b..bb502bc 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -658,6 +658,10 @@ virt_viewer_app_window_new(VirtViewerApp *self, gint nth)
     VirtViewerWindow* window;
     GtkWindow *w;
 
+    window = virt_viewer_app_get_nth_window(self, nth);
+    if (window)
+        return window;
+
     window = g_object_new(VIRT_VIEWER_TYPE_WINDOW, "app", self, NULL);
     if (self->priv->main_window)
         virt_viewer_window_set_zoom_level(window, virt_viewer_window_get_zoom_level(self->priv->main_window));
-- 
1.8.3.rc1.49.g8d97506

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux