Make gtk_launch_uri more robust
authorMatthias Clasen <mclasen@redhat.com>
Tue, 6 Sep 2022 16:37:56 +0000 (12:37 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 6 Sep 2022 16:37:56 +0000 (12:37 -0400)
We were failing to launch the uri if we are on
Wayland, but have no xdg_foreign protocol support.

Fixes: #5152
gtk/gtkshow.c

index d1a090698984a84805ea63e813dcd734d16bac67..4dd8b9e89c8df5d6150d2d149c8f718bf1e8a049 100644 (file)
@@ -127,9 +127,7 @@ gtk_show_uri_full (GtkWindow           *parent,
   data->task = g_task_new (parent, cancellable, callback, user_data);
   g_task_set_source_tag (data->task, gtk_show_uri);
 
-  if (parent)
-    gtk_window_export_handle (parent, window_handle_exported, data);
-  else
+  if (!parent || !gtk_window_export_handle (parent, window_handle_exported, data))
     window_handle_exported (parent, NULL, data);
 }