Commit 06f75b37 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Make GdkAppLaunchContext display-dependent

Add a GdkDisplay::get_app_launch_context vfunc, and a
gdk_display_get_app_launch_context that for X11 returns a subclass.
For win32 and quartz, the implementations were trivial, so we
just return a new GdkAppLaunchContext without subclassing. Since
the type of the context now depends on the display,
gdk_app_launch_context_set_display is deprecated.
parent de84a7b1
...@@ -85,6 +85,7 @@ gdk_display_beep ...@@ -85,6 +85,7 @@ gdk_display_beep
gdk_display_close gdk_display_close
gdk_display_device_is_grabbed gdk_display_device_is_grabbed
gdk_display_flush gdk_display_flush
gdk_display_get_app_launch_context
gdk_display_get_default gdk_display_get_default
gdk_display_get_default_cursor_size gdk_display_get_default_cursor_size
gdk_display_get_default_group gdk_display_get_default_group
......
...@@ -61,10 +61,14 @@ static void gdk_app_launch_context_finalize (GObject *object); ...@@ -61,10 +61,14 @@ static void gdk_app_launch_context_finalize (GObject *object);
static gchar * gdk_app_launch_context_get_display (GAppLaunchContext *context, static gchar * gdk_app_launch_context_get_display (GAppLaunchContext *context,
GAppInfo *info, GAppInfo *info,
GList *files); GList *files);
static gchar * gdk_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
GAppInfo *info,
GList *files);
static void gdk_app_launch_context_launch_failed (GAppLaunchContext *context,
const gchar *startup_notify_id);
G_DEFINE_TYPE (GdkAppLaunchContext, gdk_app_launch_context, G_DEFINE_TYPE (GdkAppLaunchContext, gdk_app_launch_context, G_TYPE_APP_LAUNCH_CONTEXT)
G_TYPE_APP_LAUNCH_CONTEXT)
static void static void
gdk_app_launch_context_class_init (GdkAppLaunchContextClass *klass) gdk_app_launch_context_class_init (GdkAppLaunchContextClass *klass)
...@@ -75,8 +79,8 @@ gdk_app_launch_context_class_init (GdkAppLaunchContextClass *klass) ...@@ -75,8 +79,8 @@ gdk_app_launch_context_class_init (GdkAppLaunchContextClass *klass)
gobject_class->finalize = gdk_app_launch_context_finalize; gobject_class->finalize = gdk_app_launch_context_finalize;
context_class->get_display = gdk_app_launch_context_get_display; context_class->get_display = gdk_app_launch_context_get_display;
context_class->get_startup_notify_id = _gdk_windowing_get_startup_notify_id; context_class->get_startup_notify_id = gdk_app_launch_context_get_startup_notify_id;
context_class->launch_failed = _gdk_windowing_launch_failed; context_class->launch_failed = gdk_app_launch_context_launch_failed;
g_type_class_add_private (klass, sizeof (GdkAppLaunchContextPrivate)); g_type_class_add_private (klass, sizeof (GdkAppLaunchContextPrivate));
} }
...@@ -85,8 +89,8 @@ static void ...@@ -85,8 +89,8 @@ static void
gdk_app_launch_context_init (GdkAppLaunchContext *context) gdk_app_launch_context_init (GdkAppLaunchContext *context)
{ {
context->priv = G_TYPE_INSTANCE_GET_PRIVATE (context, context->priv = G_TYPE_INSTANCE_GET_PRIVATE (context,
GDK_TYPE_APP_LAUNCH_CONTEXT, GDK_TYPE_APP_LAUNCH_CONTEXT,
GdkAppLaunchContextPrivate); GdkAppLaunchContextPrivate);
context->priv->workspace = -1; context->priv->workspace = -1;
} }
...@@ -144,22 +148,17 @@ gdk_app_launch_context_get_display (GAppLaunchContext *context, ...@@ -144,22 +148,17 @@ gdk_app_launch_context_get_display (GAppLaunchContext *context,
* using this context. See also gdk_app_launch_context_set_screen(). * using this context. See also gdk_app_launch_context_set_screen().
* *
* Since: 2.14 * Since: 2.14
*
* Deprecated: 3.0: Use gdk_display_get_app_launch_context() instead
*/ */
void void
gdk_app_launch_context_set_display (GdkAppLaunchContext *context, gdk_app_launch_context_set_display (GdkAppLaunchContext *context,
GdkDisplay *display) GdkDisplay *display)
{ {
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context)); g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
g_return_if_fail (display == NULL || GDK_IS_DISPLAY (display)); g_return_if_fail (display == NULL || GDK_IS_DISPLAY (display));
if (context->priv->display) g_warn_if_fail (display == NULL || display == context->priv->display);
{
g_object_unref (context->priv->display);
context->priv->display = NULL;
}
if (display)
context->priv->display = g_object_ref (display);
} }
/** /**
...@@ -178,11 +177,13 @@ gdk_app_launch_context_set_display (GdkAppLaunchContext *context, ...@@ -178,11 +177,13 @@ gdk_app_launch_context_set_display (GdkAppLaunchContext *context,
*/ */
void void
gdk_app_launch_context_set_screen (GdkAppLaunchContext *context, gdk_app_launch_context_set_screen (GdkAppLaunchContext *context,
GdkScreen *screen) GdkScreen *screen)
{ {
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context)); g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
g_return_if_fail (screen == NULL || GDK_IS_SCREEN (screen)); g_return_if_fail (screen == NULL || GDK_IS_SCREEN (screen));
g_return_if_fail (screen == NULL || gdk_screen_get_display (screen) == context->priv->display);
if (context->priv->screen) if (context->priv->screen)
{ {
g_object_unref (context->priv->screen); g_object_unref (context->priv->screen);
...@@ -199,12 +200,12 @@ gdk_app_launch_context_set_screen (GdkAppLaunchContext *context, ...@@ -199,12 +200,12 @@ gdk_app_launch_context_set_screen (GdkAppLaunchContext *context,
* @desktop: the number of a workspace, or -1 * @desktop: the number of a workspace, or -1
* *
* Sets the workspace on which applications will be launched when * Sets the workspace on which applications will be launched when
* using this context when running under a window manager that * using this context when running under a window manager that
* supports multiple workspaces, as described in the * supports multiple workspaces, as described in the
* <ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended * <ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended
* Window Manager Hints</ulink>. * Window Manager Hints</ulink>.
* *
* When the workspace is not specified or @desktop is set to -1, * When the workspace is not specified or @desktop is set to -1,
* it is up to the window manager to pick one, typically it will * it is up to the window manager to pick one, typically it will
* be the current workspace. * be the current workspace.
* *
...@@ -212,7 +213,7 @@ gdk_app_launch_context_set_screen (GdkAppLaunchContext *context, ...@@ -212,7 +213,7 @@ gdk_app_launch_context_set_screen (GdkAppLaunchContext *context,
*/ */
void void
gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context, gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context,
gint desktop) gint desktop)
{ {
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context)); g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
...@@ -225,7 +226,7 @@ gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context, ...@@ -225,7 +226,7 @@ gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context,
* @timestamp: a timestamp * @timestamp: a timestamp
* *
* Sets the timestamp of @context. The timestamp should ideally * Sets the timestamp of @context. The timestamp should ideally
* be taken from the event that triggered the launch. * be taken from the event that triggered the launch.
* *
* Window managers can use this information to avoid moving the * Window managers can use this information to avoid moving the
* focus to the newly launched application when the user is busy * focus to the newly launched application when the user is busy
...@@ -236,7 +237,7 @@ gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context, ...@@ -236,7 +237,7 @@ gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context,
*/ */
void void
gdk_app_launch_context_set_timestamp (GdkAppLaunchContext *context, gdk_app_launch_context_set_timestamp (GdkAppLaunchContext *context,
guint32 timestamp) guint32 timestamp)
{ {
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context)); g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
...@@ -280,20 +281,20 @@ gdk_app_launch_context_set_icon (GdkAppLaunchContext *context, ...@@ -280,20 +281,20 @@ gdk_app_launch_context_set_icon (GdkAppLaunchContext *context,
* @context: a #GdkAppLaunchContext * @context: a #GdkAppLaunchContext
* @icon_name: (allow-none): an icon name, or %NULL * @icon_name: (allow-none): an icon name, or %NULL
* *
* Sets the icon for applications that are launched with this context. * Sets the icon for applications that are launched with this context.
* The @icon_name will be interpreted in the same way as the Icon field * The @icon_name will be interpreted in the same way as the Icon field
* in desktop files. See also gdk_app_launch_context_set_icon(). * in desktop files. See also gdk_app_launch_context_set_icon().
* *
* If both @icon and @icon_name are set, the @icon_name takes priority. * If both @icon and @icon_name are set, the @icon_name takes priority.
* If neither @icon or @icon_name is set, the icon is taken from either * If neither @icon or @icon_name is set, the icon is taken from either
* the file that is passed to launched application or from the #GAppInfo * the file that is passed to launched application or from the #GAppInfo
* for the launched application itself. * for the launched application itself.
* *
* Since: 2.14 * Since: 2.14
*/ */
void void
gdk_app_launch_context_set_icon_name (GdkAppLaunchContext *context, gdk_app_launch_context_set_icon_name (GdkAppLaunchContext *context,
const char *icon_name) const char *icon_name)
{ {
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context)); g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
...@@ -309,9 +310,25 @@ gdk_app_launch_context_set_icon_name (GdkAppLaunchContext *context, ...@@ -309,9 +310,25 @@ gdk_app_launch_context_set_icon_name (GdkAppLaunchContext *context,
* Returns: a new #GdkAppLaunchContext * Returns: a new #GdkAppLaunchContext
* *
* Since: 2.14 * Since: 2.14
*
* Deprecated: 3.0: Use gdk_display_get_app_launch_context() instead
*/ */
GdkAppLaunchContext * GdkAppLaunchContext *
gdk_app_launch_context_new (void) gdk_app_launch_context_new (void)
{ {
return g_object_new (GDK_TYPE_APP_LAUNCH_CONTEXT, NULL); return gdk_display_get_app_launch_context (gdk_display_get_default ());
}
static char *
gdk_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
GAppInfo *info,
GList *files)
{
return NULL;
}
static void
gdk_app_launch_context_launch_failed (GAppLaunchContext *context,
const gchar *startup_notify_id)
{
} }
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#define __GDK_APP_LAUNCH_CONTEXT_H__ #define __GDK_APP_LAUNCH_CONTEXT_H__
#include <gio/gio.h> #include <gio/gio.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkscreen.h> #include <gdk/gdkscreen.h>
G_BEGIN_DECLS G_BEGIN_DECLS
...@@ -39,7 +40,6 @@ G_BEGIN_DECLS ...@@ -39,7 +40,6 @@ G_BEGIN_DECLS
#define GDK_IS_APP_LAUNCH_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDK_TYPE_APP_LAUNCH_CONTEXT)) #define GDK_IS_APP_LAUNCH_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDK_TYPE_APP_LAUNCH_CONTEXT))
#define GDK_APP_LAUNCH_CONTEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_APP_LAUNCH_CONTEXT, GdkAppLaunchContextClass)) #define GDK_APP_LAUNCH_CONTEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_APP_LAUNCH_CONTEXT, GdkAppLaunchContextClass))
typedef struct GdkAppLaunchContext GdkAppLaunchContext;
typedef struct GdkAppLaunchContextClass GdkAppLaunchContextClass; typedef struct GdkAppLaunchContextClass GdkAppLaunchContextClass;
typedef struct GdkAppLaunchContextPrivate GdkAppLaunchContextPrivate; typedef struct GdkAppLaunchContextPrivate GdkAppLaunchContextPrivate;
......
...@@ -121,8 +121,7 @@ static GdkWindow* singlehead_default_window_get_pointer (GdkWindow *window ...@@ -121,8 +121,7 @@ static GdkWindow* singlehead_default_window_get_pointer (GdkWindow *window
GdkModifierType *mask); GdkModifierType *mask);
static GdkWindow* singlehead_default_window_at_pointer (GdkScreen *screen, static GdkWindow* singlehead_default_window_at_pointer (GdkScreen *screen,
gint *win_x, gint *win_x,
gint *win_y); gint *win_y);static GdkWindow *gdk_window_real_window_get_device_position (GdkDisplay *display,
static GdkWindow *gdk_window_real_window_get_device_position (GdkDisplay *display,
GdkDevice *device, GdkDevice *device,
GdkWindow *window, GdkWindow *window,
gint *x, gint *x,
...@@ -132,6 +131,7 @@ static GdkWindow *gdk_display_real_get_window_at_device_position (GdkDisplay ...@@ -132,6 +131,7 @@ static GdkWindow *gdk_display_real_get_window_at_device_position (GdkDisplay
GdkDevice *device, GdkDevice *device,
gint *win_x, gint *win_x,
gint *win_y); gint *win_y);
static GdkAppLaunchContext *gdk_display_real_get_app_launch_context (GdkDisplay *display);
static guint signals[LAST_SIGNAL] = { 0 }; static guint signals[LAST_SIGNAL] = { 0 };
...@@ -179,6 +179,8 @@ gdk_display_class_init (GdkDisplayClass *class) ...@@ -179,6 +179,8 @@ gdk_display_class_init (GdkDisplayClass *class)
object_class->finalize = gdk_display_finalize; object_class->finalize = gdk_display_finalize;
object_class->dispose = gdk_display_dispose; object_class->dispose = gdk_display_dispose;
class->get_app_launch_context = gdk_display_real_get_app_launch_context;
/** /**
* GdkDisplay::opened: * GdkDisplay::opened:
* @display: the object on which the signal is emitted * @display: the object on which the signal is emitted
...@@ -2211,3 +2213,32 @@ gdk_add_client_message_filter (GdkAtom message_type, ...@@ -2211,3 +2213,32 @@ gdk_add_client_message_filter (GdkAtom message_type,
gdk_display_add_client_message_filter (gdk_display_get_default (), gdk_display_add_client_message_filter (gdk_display_get_default (),
message_type, func, data); message_type, func, data);
} }
static GdkAppLaunchContext *
gdk_display_real_get_app_launch_context (GdkDisplay *display)
{
GdkAppLaunchContext *ctx;
ctx = gdk_app_launch_context_new ();
gdk_app_launch_context_set_display (ctx, display);
return ctx;
}
/**
* gdk_display_get_app_launch_context:
* @display: a #GdkDisplay
*
* Returns a #GdkAppLaunchContext suitable for launching
* applications on the given display.
*
* Returns: a new #GdkAppLaunchContext for @display.
* Free with g_object_unref() when done
*
* Since: 3.0
*/
GdkAppLaunchContext *
gdk_display_get_app_launch_context (GdkDisplay *display)
{
return GDK_DISPLAY_GET_CLASS(display)->get_app_launch_context (display);
}
...@@ -309,6 +309,8 @@ gboolean gdk_display_supports_composite (GdkDisplay *display); ...@@ -309,6 +309,8 @@ gboolean gdk_display_supports_composite (GdkDisplay *display);
GdkDeviceManager * gdk_display_get_device_manager (GdkDisplay *display); GdkDeviceManager * gdk_display_get_device_manager (GdkDisplay *display);
GdkAppLaunchContext *gdk_display_get_app_launch_context (GdkDisplay *display);
G_END_DECLS G_END_DECLS
......
...@@ -304,6 +304,7 @@ struct _GdkDisplayClass ...@@ -304,6 +304,7 @@ struct _GdkDisplayClass
GdkAtom message_type, GdkAtom message_type,
GdkFilterFunc func, GdkFilterFunc func,
gpointer data); gpointer data);
GdkAppLaunchContext * (*get_app_launch_context) (GdkDisplay *display);
/* Signals */ /* Signals */
...@@ -575,12 +576,6 @@ struct GdkAppLaunchContextPrivate ...@@ -575,12 +576,6 @@ struct GdkAppLaunchContextPrivate
char *icon_name; char *icon_name;
}; };
char *_gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
GAppInfo *info,
GList *files);
void _gdk_windowing_launch_failed (GAppLaunchContext *context,
const char *startup_notify_id);
void _gdk_display_device_grab_update (GdkDisplay *display, void _gdk_display_device_grab_update (GdkDisplay *display,
GdkDevice *device, GdkDevice *device,
GdkDevice *source_device, GdkDevice *source_device,
......
...@@ -147,6 +147,7 @@ typedef struct _GdkVisual GdkVisual; ...@@ -147,6 +147,7 @@ typedef struct _GdkVisual GdkVisual;
typedef struct _GdkWindow GdkWindow; typedef struct _GdkWindow GdkWindow;
typedef struct _GdkDisplay GdkDisplay; typedef struct _GdkDisplay GdkDisplay;
typedef struct _GdkScreen GdkScreen; typedef struct _GdkScreen GdkScreen;
typedef struct GdkAppLaunchContext GdkAppLaunchContext;
/** /**
* GdkByteOrder: * GdkByteOrder:
......
...@@ -21,7 +21,6 @@ libgdk_quartz_la_SOURCES = \ ...@@ -21,7 +21,6 @@ libgdk_quartz_la_SOURCES = \
GdkQuartzView.h \ GdkQuartzView.h \
GdkQuartzWindow.c \ GdkQuartzWindow.c \
GdkQuartzWindow.h \ GdkQuartzWindow.h \
gdkapplaunchcontext-quartz.c \
gdkcursor-quartz.c \ gdkcursor-quartz.c \
gdkdevice-core.c \ gdkdevice-core.c \
gdkdevicemanager-core.c \ gdkdevicemanager-core.c \
......
/* gdkapplaunchcontext-quartz.c - Gtk+ implementation for GAppLaunchContext
Copyright (C) 2007 Red Hat, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Matthias Clasen <mclasen@redhat.com>
*/
#include "config.h"
#include "gdkapplaunchcontext.h"
char *
_gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
GAppInfo *info,
GList *files)
{
return NULL;
}
void
_gdk_windowing_launch_failed (GAppLaunchContext *context,
const char *startup_notify_id)
{
}
...@@ -26,7 +26,6 @@ EXTRA_DIST += \ ...@@ -26,7 +26,6 @@ EXTRA_DIST += \
libgdk_win32_la_SOURCES = \ libgdk_win32_la_SOURCES = \
xcursors.h \ xcursors.h \
gdkapplaunchcontext-win32.c \
gdkcursor-win32.c \ gdkcursor-win32.c \
gdkdevicemanager-win32.c \ gdkdevicemanager-win32.c \
gdkdevicemanager-win32.h \ gdkdevicemanager-win32.h \
......
/* gdkapplaunchcontext-win32.c - Gtk+ implementation for GAppLaunchContext
Copyright (C) 2007 Red Hat, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Matthias Clasen <mclasen@redhat.com>
*/
#include "config.h"
#include "gdkapplaunchcontext.h"
char *
_gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
GAppInfo *info,
GList *files)
{
return NULL;
}
void
_gdk_windowing_launch_failed (GAppLaunchContext *context,
const char *startup_notify_id)
{
}
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
#include "config.h" #include "config.h"
#include "gdkapplaunchcontext.h" #include "gdkapplaunchcontext.h"
#include "gdkinternals.h"
#include "gdkx.h" #include "gdkx.h"
#include "gdkscreen.h" #include "gdkscreen.h"
#include "gdkinternals.h"
#include "gdkintl.h" #include "gdkintl.h"
#include <glib.h> #include <glib.h>
...@@ -258,10 +258,10 @@ add_startup_timeout (GdkScreen *screen, ...@@ -258,10 +258,10 @@ add_startup_timeout (GdkScreen *screen,
} }
char * static char *
_gdk_windowing_get_startup_notify_id (GAppLaunchContext *context, gdk_app_launch_context_x11_get_startup_notify_id (GAppLaunchContext *context,
GAppInfo *info, GAppInfo *info,
GList *files) GList *files)
{ {
static int sequence = 0; static int sequence = 0;
GdkAppLaunchContextPrivate *priv; GdkAppLaunchContextPrivate *priv;
...@@ -281,21 +281,11 @@ _gdk_windowing_get_startup_notify_id (GAppLaunchContext *context, ...@@ -281,21 +281,11 @@ _gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
priv = GDK_APP_LAUNCH_CONTEXT (context)->priv; priv = GDK_APP_LAUNCH_CONTEXT (context)->priv;
display = priv->display;
if (priv->screen) if (priv->screen)
{ screen = priv->screen;
screen = priv->screen;
display = gdk_screen_get_display (priv->screen);
}
else if (priv->display)
{
display = priv->display;
screen = gdk_display_get_default_screen (display);
}
else else
{ screen = gdk_display_get_default_screen (priv->display);
display = gdk_display_get_default ();
screen = gdk_display_get_default_screen (display);
}
fileinfo = NULL; fileinfo = NULL;
...@@ -398,9 +388,9 @@ _gdk_windowing_get_startup_notify_id (GAppLaunchContext *context, ...@@ -398,9 +388,9 @@ _gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
} }
void static void
_gdk_windowing_launch_failed (GAppLaunchContext *context, gdk_app_launch_context_x11_launch_failed (GAppLaunchContext *context,
const char *startup_notify_id) const char *startup_notify_id)
{ {
GdkAppLaunchContextPrivate *priv; GdkAppLaunchContextPrivate *priv;
GdkScreen *screen; GdkScreen *screen;
...@@ -412,10 +402,8 @@ _gdk_windowing_launch_failed (GAppLaunchContext *context, ...@@ -412,10 +402,8 @@ _gdk_windowing_launch_failed (GAppLaunchContext *context,
if (priv->screen) if (priv->screen)
screen = priv->screen; screen = priv->screen;
else if (priv->display)
screen = gdk_display_get_default_screen (priv->display);
else else
screen = gdk_display_get_default_screen (gdk_display_get_default ()); screen = gdk_display_get_default_screen (priv->display);