diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2011-01-13 16:03:49 +0100 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2011-01-13 16:18:59 +0100 |
commit | 7e29fc5b421a049c2b88453232eddeefed9f1b7b (patch) | |
tree | 0c977363d4940d8e35a0b704d001db83c2dbc3f2 /gtk/gtkshow.c | |
parent | 04494c5df0df3c9867ecc1b0116b761e68557c1c (diff) | |
download | gtk+-7e29fc5b421a049c2b88453232eddeefed9f1b7b.tar.gz |
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.
Diffstat (limited to 'gtk/gtkshow.c')
-rw-r--r-- | gtk/gtkshow.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk/gtkshow.c b/gtk/gtkshow.c index ac3d1ac974..ad396a27f9 100644 --- a/gtk/gtkshow.c +++ b/gtk/gtkshow.c @@ -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); |