core/launch-context: Guard X11 calls
Also make use of display where possible to avoid a warning about an unused display variable if one tries to build without x11 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3540>
This commit is contained in:
parent
d8812c0d2f
commit
e68a8a0a17
@ -23,7 +23,10 @@
|
|||||||
|
|
||||||
#include "core/display-private.h"
|
#include "core/display-private.h"
|
||||||
#include "meta/meta-launch-context.h"
|
#include "meta/meta-launch-context.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_X11_CLIENT
|
||||||
#include "x11/meta-startup-notification-x11.h"
|
#include "x11/meta-startup-notification-x11.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct _MetaLaunchContext MetaLaunchContext;
|
typedef struct _MetaLaunchContext MetaLaunchContext;
|
||||||
|
|
||||||
@ -135,6 +138,7 @@ meta_launch_context_get_startup_notify_id (GAppLaunchContext *launch_context,
|
|||||||
if (context->workspace)
|
if (context->workspace)
|
||||||
workspace_idx = meta_workspace_index (context->workspace);
|
workspace_idx = meta_workspace_index (context->workspace);
|
||||||
|
|
||||||
|
#ifdef HAVE_X11_CLIENT
|
||||||
if (display->x11_display)
|
if (display->x11_display)
|
||||||
{
|
{
|
||||||
/* If there is a X11 display, we prefer going entirely through
|
/* If there is a X11 display, we prefer going entirely through
|
||||||
@ -148,6 +152,7 @@ meta_launch_context_get_startup_notify_id (GAppLaunchContext *launch_context,
|
|||||||
context->timestamp,
|
context->timestamp,
|
||||||
workspace_idx);
|
workspace_idx);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!startup_id)
|
if (!startup_id)
|
||||||
{
|
{
|
||||||
@ -166,7 +171,7 @@ meta_launch_context_get_startup_notify_id (GAppLaunchContext *launch_context,
|
|||||||
g_desktop_app_info_get_filename (G_DESKTOP_APP_INFO (info));
|
g_desktop_app_info_get_filename (G_DESKTOP_APP_INFO (info));
|
||||||
}
|
}
|
||||||
|
|
||||||
sn = meta_display_get_startup_notification (context->display);
|
sn = meta_display_get_startup_notification (display);
|
||||||
seq = g_object_new (META_TYPE_STARTUP_SEQUENCE,
|
seq = g_object_new (META_TYPE_STARTUP_SEQUENCE,
|
||||||
"display", context->display,
|
"display", context->display,
|
||||||
"id", startup_id,
|
"id", startup_id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user