mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
gtkshow: don't call _get_display() on a NULL GdkScreen
gtk_show_uri() is documented to accept a NULL screen to mean the default one. Calling gdk_screen_get_display() on a NULL object will cause segfaults.
This commit is contained in:
parent
04494c5df0
commit
7e29fc5b42
@ -63,10 +63,16 @@ gtk_show_uri (GdkScreen *screen,
|
||||
{
|
||||
GdkAppLaunchContext *context;
|
||||
gboolean ret;
|
||||
GdkDisplay *display;
|
||||
|
||||
g_return_val_if_fail (uri != NULL, FALSE);
|
||||
|
||||
context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
|
||||
if (screen != NULL)
|
||||
display = gdk_screen_get_display (screen);
|
||||
else
|
||||
display = gdk_display_get_default ();
|
||||
|
||||
context = gdk_display_get_app_launch_context (display);
|
||||
gdk_app_launch_context_set_screen (context, screen);
|
||||
gdk_app_launch_context_set_timestamp (context, timestamp);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user