Use gtk_show_uri_on_window() instead gtk_show_uri()

This commit is contained in:
Javier Jardón 2017-08-04 15:11:36 +01:00
parent 896f7c8ac0
commit d3954f614c
2 changed files with 4 additions and 3 deletions

View File

@ -1767,18 +1767,19 @@ open_folder_cb (GSimpleAction *action,
gpointer data)
{
GtkFileChooserWidget *impl = data;
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (impl));
GSList *files;
files = get_selected_files (impl);
/* Sigh, just use the first one */
if (files)
if (files && gtk_widget_is_toplevel (toplevel))
{
GFile *file = files->data;
gchar *uri;
uri = g_file_get_uri (file);
gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (impl)), uri, gtk_get_current_event_time (), NULL);
gtk_show_uri_on_window (GTK_WINDOW (toplevel), uri, gtk_get_current_event_time (), NULL);
g_free (uri);
}

View File

@ -312,7 +312,7 @@ gtk_print_operation_unix_launch_preview (GtkPrintOperation *op,
g_error_free (error);
error = NULL;
uri = g_filename_to_uri (filename, NULL, NULL);
gtk_show_uri (screen, uri, GDK_CURRENT_TIME, &error);
gtk_show_uri_on_window (parent, uri, GDK_CURRENT_TIME, &error);
g_free (uri);
}