remote-viewer-connect: Keep the 'dialog' window on top

Otherwise, in kiosk mode, it'll be hidden from user.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1459800

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
This commit is contained in:
Victor Toso 2017-06-09 17:27:32 +02:00
parent 0cd836dd17
commit 58dd08f222
3 changed files with 5 additions and 3 deletions

View File

@ -172,7 +172,7 @@ make_label_small(GtkLabel* label)
* @return FALSE if Cancel is pressed or dialog is closed
*/
gboolean
remote_viewer_connect_dialog(gchar **uri)
remote_viewer_connect_dialog(GtkWindow *main_window, gchar **uri)
{
GtkWidget *window, *label, *entry, *recent, *connect_button, *cancel_button;
GtkRecentFilter *rfilter;
@ -192,6 +192,7 @@ remote_viewer_connect_dialog(gchar **uri)
g_return_val_if_fail(builder != NULL, GTK_RESPONSE_NONE);
window = GTK_WIDGET(gtk_builder_get_object(builder, "remote-viewer-connection-window"));
gtk_window_set_transient_for(GTK_WINDOW(window), main_window);
connect_button = GTK_WIDGET(gtk_builder_get_object(builder, "connect-button"));
cancel_button = GTK_WIDGET(gtk_builder_get_object(builder, "cancel-button"));
label = GTK_WIDGET(gtk_builder_get_object(builder, "example-label"));

View File

@ -23,7 +23,7 @@
#include <gtk/gtk.h>
gboolean remote_viewer_connect_dialog(gchar **uri);
gboolean remote_viewer_connect_dialog(GtkWindow *main_window, gchar **uri);
#endif /* REMOTE_VIEWER_CONNECT_H */

View File

@ -1118,7 +1118,8 @@ remote_viewer_start(VirtViewerApp *app, GError **err)
#endif
retry_dialog:
if (priv->open_recent_dialog) {
if (!remote_viewer_connect_dialog(&guri)) {
VirtViewerWindow *main_window = virt_viewer_app_get_main_window(app);
if (!remote_viewer_connect_dialog(virt_viewer_window_get_window(main_window), &guri)) {
g_set_error_literal(&error,
VIRT_VIEWER_ERROR, VIRT_VIEWER_ERROR_CANCELLED,
_("No connection was chosen"));