pasystray: add patch to fix crash when running under wayland

+39
+5
pkgs/tools/audio/pasystray/default.nix
··· 14 sha256 = "0xx1bm9kimgq11a359ikabdndqg5q54pn1d1dyyjnrj0s41168fk"; 15 }; 16 17 nativeBuildInputs = [ pkgconfig autoreconfHook wrapGAppsHook ]; 18 buildInputs = [ 19 gnome3.adwaita-icon-theme
··· 14 sha256 = "0xx1bm9kimgq11a359ikabdndqg5q54pn1d1dyyjnrj0s41168fk"; 15 }; 16 17 + patches = [ 18 + # https://github.com/christophgysin/pasystray/issues/90#issuecomment-306190701 19 + ./fix-wayland.patch 20 + ]; 21 + 22 nativeBuildInputs = [ pkgconfig autoreconfHook wrapGAppsHook ]; 23 buildInputs = [ 24 gnome3.adwaita-icon-theme
+34
pkgs/tools/audio/pasystray/fix-wayland.patch
···
··· 1 + --- a/src/x11-property.c 2 + +++ b/src/x11-property.c 3 + @@ -43,11 +43,15 @@ static Window window; 4 + void x11_property_init() 5 + { 6 + display = gdk_x11_get_default_xdisplay(); 7 + + if (!GDK_IS_X11_DISPLAY(display)) return; 8 + + Screen* scr = ScreenOfDisplay(display, 0); 9 + + 10 + window = RootWindow(display, 0); 11 + } 12 + 13 + void x11_property_set(const char* key, const char* value) 14 + { 15 + + if (!GDK_IS_X11_DISPLAY(display)) return; 16 + g_debug("[x11-property] setting '%s' to '%s'", key, value); 17 + 18 + Atom atom = XInternAtom(display, key, False); 19 + @@ -57,6 +61,7 @@ void x11_property_set(const char* key, c 20 + 21 + void x11_property_del(const char* key) 22 + { 23 + + if (!GDK_IS_X11_DISPLAY(display)) return; 24 + g_debug("[x11-property] deleting '%s'", key); 25 + 26 + Atom atom = XInternAtom(display, key, False); 27 + @@ -65,6 +70,7 @@ void x11_property_del(const char* key) 28 + 29 + char* x11_property_get(const char* key) 30 + { 31 + + if (!GDK_IS_X11_DISPLAY(display)) return NULL; 32 + Atom property = XInternAtom(display, key, False); 33 + Atom actual_type; 34 + int actual_format;