summary refs log tree commit diff
path: root/pkgs/tools/audio/pasystray/fix-wayland.patch
blob: 17c4e2e6d65893f910a15cb41c308d831366c8af (plain) (blame)
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
--- a/src/x11-property.c
+++ b/src/x11-property.c
@@ -43,11 +43,15 @@ static Window window;
 void x11_property_init()
 {
     display = gdk_x11_get_default_xdisplay();
+    if (!GDK_IS_X11_DISPLAY(display)) return;
+    Screen* scr = ScreenOfDisplay(display, 0);
+
     window = RootWindow(display, 0);
 }
 
 void x11_property_set(const char* key, const char* value)
 {
+    if (!GDK_IS_X11_DISPLAY(display)) return;
     g_debug("[x11-property] setting '%s' to '%s'", key, value);
 
     Atom atom = XInternAtom(display, key, False);
@@ -57,6 +61,7 @@ void x11_property_set(const char* key, c
 
 void x11_property_del(const char* key)
 {
+    if (!GDK_IS_X11_DISPLAY(display)) return;
     g_debug("[x11-property] deleting '%s'", key);
 
     Atom atom = XInternAtom(display, key, False);
@@ -65,6 +70,7 @@ void x11_property_del(const char* key)
 
 char* x11_property_get(const char* key)
 {
+    if (!GDK_IS_X11_DISPLAY(display)) return NULL;
     Atom property = XInternAtom(display, key, False);
     Atom actual_type;
     int actual_format;