[poppler] glib/demo

Adrian Johnson ajohnson at kemper.freedesktop.org
Sat Oct 28 09:25:50 UTC 2017


 glib/demo/utils.c |   20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

New commits:
commit b9ae2fd75c147988653093d0ecbf66188d81f8fc
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sun Oct 22 18:29:31 2017 +1030

    glib demo: correct the previous warnings fix
    
    Bug 103050

diff --git a/glib/demo/utils.c b/glib/demo/utils.c
index ad9405aa..aa6cd761 100644
--- a/glib/demo/utils.c
+++ b/glib/demo/utils.c
@@ -275,8 +275,11 @@ pgd_action_view_play_rendition (GtkWidget    *button,
 		g_object_unref (file);
 		if (uri) {
 #if GTK_CHECK_VERSION(3, 22, 0)
-			gtk_show_uri_on_window (GTK_WINDOW(gtk_widget_get_window (button)),
-				      uri, GDK_CURRENT_TIME, NULL);
+			GtkWidget *toplevel;
+
+			toplevel = gtk_widget_get_toplevel (button);
+			gtk_show_uri_on_window (gtk_widget_is_toplevel (toplevel) ? GTK_WINDOW (toplevel) : NULL,
+						uri, GDK_CURRENT_TIME, NULL);
 #else
 			gtk_show_uri (gtk_widget_get_screen (button),
 				      uri, GDK_CURRENT_TIME, NULL);
@@ -543,13 +546,16 @@ pgd_movie_view_play_movie (GtkWidget    *button,
 	g_object_unref (file);
 	if (uri) {
 #if GTK_CHECK_VERSION(3, 22, 0)
-	    gtk_show_uri_on_window (GTK_WINDOW(gtk_widget_get_window (button)),
-				    uri, GDK_CURRENT_TIME, NULL);
+		GtkWidget *toplevel;
+
+		toplevel = gtk_widget_get_toplevel (button);
+		gtk_show_uri_on_window (gtk_widget_is_toplevel (toplevel) ? GTK_WINDOW (toplevel) : NULL,
+		uri, GDK_CURRENT_TIME, NULL);
 #else
-	    gtk_show_uri (gtk_widget_get_screen (button),
-			  uri, GDK_CURRENT_TIME, NULL);
+		gtk_show_uri (gtk_widget_get_screen (button),
+			      uri, GDK_CURRENT_TIME, NULL);
 #endif
-	    g_free (uri);
+		g_free (uri);
 	}
 }
 


More information about the poppler mailing list