summaryrefslogtreecommitdiff
blob: 2aab3af021468dfcdc81d7d7da60e2fb57759737 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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);