Blame SOURCES/0042-remote-viewer-connect-Keep-the-dialog-window-on-top.patch

48c875
From 40b92b6b4fa4eb81c2b746365a6a056b3666ee81 Mon Sep 17 00:00:00 2001
48c875
From: Victor Toso <me@victortoso.com>
48c875
Date: Fri, 9 Jun 2017 17:27:32 +0200
48c875
Subject: [PATCH] remote-viewer-connect: Keep the 'dialog' window on top
48c875
48c875
Otherwise, in kiosk mode, it'll be hidden from user.
48c875
48c875
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1459800
48c875
48c875
Signed-off-by: Victor Toso <victortoso@redhat.com>
48c875
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
48c875
---
48c875
 src/remote-viewer-connect.c | 3 ++-
48c875
 src/remote-viewer-connect.h | 2 +-
48c875
 src/remote-viewer.c         | 3 ++-
48c875
 3 files changed, 5 insertions(+), 3 deletions(-)
48c875
48c875
diff --git a/src/remote-viewer-connect.c b/src/remote-viewer-connect.c
48c875
index 2fbc5ff..14594ac 100644
48c875
--- a/src/remote-viewer-connect.c
48c875
+++ b/src/remote-viewer-connect.c
48c875
@@ -172,7 +172,7 @@ make_label_small(GtkLabel* label)
48c875
 * @return FALSE if Cancel is pressed or dialog is closed
48c875
 */
48c875
 gboolean
48c875
-remote_viewer_connect_dialog(gchar **uri)
48c875
+remote_viewer_connect_dialog(GtkWindow *main_window, gchar **uri)
48c875
 {
48c875
     GtkWidget *window, *label, *entry, *recent, *connect_button, *cancel_button;
48c875
     GtkRecentFilter *rfilter;
48c875
@@ -192,6 +192,7 @@ remote_viewer_connect_dialog(gchar **uri)
48c875
     g_return_val_if_fail(builder != NULL, GTK_RESPONSE_NONE);
48c875
 
48c875
     window = GTK_WIDGET(gtk_builder_get_object(builder, "remote-viewer-connection-window"));
48c875
+    gtk_window_set_transient_for(GTK_WINDOW(window), main_window);
48c875
     connect_button = GTK_WIDGET(gtk_builder_get_object(builder, "connect-button"));
48c875
     cancel_button = GTK_WIDGET(gtk_builder_get_object(builder, "cancel-button"));
48c875
     label = GTK_WIDGET(gtk_builder_get_object(builder, "example-label"));
48c875
diff --git a/src/remote-viewer-connect.h b/src/remote-viewer-connect.h
48c875
index f00581e..99779ef 100644
48c875
--- a/src/remote-viewer-connect.h
48c875
+++ b/src/remote-viewer-connect.h
48c875
@@ -23,7 +23,7 @@
48c875
 
48c875
 #include <gtk/gtk.h>
48c875
 
48c875
-gboolean remote_viewer_connect_dialog(gchar **uri);
48c875
+gboolean remote_viewer_connect_dialog(GtkWindow *main_window, gchar **uri);
48c875
 
48c875
 #endif /* REMOTE_VIEWER_CONNECT_H */
48c875
 
48c875
diff --git a/src/remote-viewer.c b/src/remote-viewer.c
48c875
index d927f8a..7834dac 100644
48c875
--- a/src/remote-viewer.c
48c875
+++ b/src/remote-viewer.c
48c875
@@ -1122,7 +1122,8 @@ remote_viewer_start(VirtViewerApp *app, GError **err)
48c875
 #endif
48c875
 retry_dialog:
48c875
         if (priv->open_recent_dialog) {
48c875
-            if (!remote_viewer_connect_dialog(&guri)) {
48c875
+            VirtViewerWindow *main_window = virt_viewer_app_get_main_window(app);
48c875
+            if (!remote_viewer_connect_dialog(virt_viewer_window_get_window(main_window), &guri)) {
48c875
                 g_set_error_literal(&error,
48c875
                             VIRT_VIEWER_ERROR, VIRT_VIEWER_ERROR_CANCELLED,
48c875
                             _("No connection was chosen"));