Blame SOURCES/0009-Return-existing-window-in-app_window_new.patch

4a6991
From 9d1bcdd906535232a886f3b170b85afe9896fcd7 Mon Sep 17 00:00:00 2001
4a6991
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>
4a6991
Date: Mon, 19 Aug 2013 19:44:25 +0200
4a6991
Subject: [PATCH] Return existing window in app_window_new()
4a6991
4a6991
Since the returned window is weak, it can already returns existing
4a6991
windows (instead of creating one and failing to insert).
4a6991
4a6991
This allows the following set_kiosk() function to create a main window
4a6991
before the app constructor is called.
4a6991
4a6991
(cherry picked from commit cd7b5761af9691745f1cee7fa863298db417f8d1)
4a6991
https://bugzilla.redhat.com/show_bug.cgi?id=1040926
4a6991
---
4a6991
 src/virt-viewer-app.c | 4 ++++
4a6991
 1 file changed, 4 insertions(+)
4a6991
4a6991
diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
4a6991
index 637896e..fd98e62 100644
4a6991
--- a/src/virt-viewer-app.c
4a6991
+++ b/src/virt-viewer-app.c
4a6991
@@ -658,6 +658,10 @@ virt_viewer_app_window_new(VirtViewerApp *self, gint nth)
4a6991
     VirtViewerWindow* window;
4a6991
     GtkWindow *w;
4a6991
 
4a6991
+    window = virt_viewer_app_get_nth_window(self, nth);
4a6991
+    if (window)
4a6991
+        return window;
4a6991
+
4a6991
     window = g_object_new(VIRT_VIEWER_TYPE_WINDOW, "app", self, NULL);
4a6991
     if (self->priv->main_window)
4a6991
         virt_viewer_window_set_zoom_level(window, virt_viewer_window_get_zoom_level(self->priv->main_window));