You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.7 KiB

From 1f90a561e4ba0e7431aeb64602e293b05a09be15 Mon Sep 17 00:00:00 2001
From: Sparky Bluefang <sparky@bluefang-logic.com>
Date: Sun, 7 Jan 2024 21:46:36 -0500
Subject: [PATCH] Fix optional wayland handling in cc-display-panel
---
meson.build | 1 +
panels/display/cc-display-panel.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/meson.build b/meson.build
index 6c3d5e3..11aafd5 100644
--- a/meson.build
+++ b/meson.build
@@ -196,6 +196,7 @@ final_message = [ '',
'** Colord support (Color management panel) : @0@'.format(colord.found()),
'** Wacom support (Wacom panel) : @0@'.format(libwacom.found()),
'** Online-Accounts support (Online-Accounts panel) : @0@'.format(goa.found()),
+ '** Wayland support : @0@'.format(cc.has_header('gdk/gdkwayland.h', dependencies: gtk)),
'',
]
message('\n'.join(final_message))
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index 5a513b4..0676f66 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -28,7 +28,9 @@
#include <libcinnamon-desktop/cdesktop-enums.h>
#include <math.h>
+#ifdef GDK_WINDOWING_WAYLAND
#include <gdk/gdkwayland.h>
+#endif
#include <libupower-glib/upower.h>
@@ -114,7 +116,11 @@ struct _CcDisplayPanel
CC_PANEL_REGISTER (CcDisplayPanel, cc_display_panel)
+#ifdef GDK_WINDOWING_WAYLAND
#define WAYLAND_SESSION() (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default()))
+#else
+#define WAYLAND_SESSION() (FALSE)
+#endif
static void update_bottom_buttons (CcDisplayPanel *panel);
static void apply_current_configuration (CcDisplayPanel *self);