From b6c248aad24637a75e50d56280860d3a8a308dc1 Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Fri, 22 Nov 2024 01:06:52 -0500 Subject: Do not call x11 functions when not in x11 *Otherwise we get segfaults --- stickynotes/stickynotes.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'stickynotes/stickynotes.c') diff --git a/stickynotes/stickynotes.c b/stickynotes/stickynotes.c index 85afdc3d..b2ebb85c 100644 --- a/stickynotes/stickynotes.c +++ b/stickynotes/stickynotes.c @@ -48,6 +48,11 @@ set_icon_geometry (GdkWindow *window, int width, int height) { + /*This is x11-only, so return in wayland or anything else*/ + GdkScreen *screen = gdk_screen_get_default(); + if (!(GDK_IS_X11_DISPLAY (gdk_screen_get_display (screen)))) + return; + gulong data[4]; Display *dpy; @@ -731,7 +736,15 @@ stickynote_set_visible (StickyNote *note, gtk_window_move (GTK_WINDOW (note->w_window), note->x, note->y); - /* Put the note on all workspaces if necessary. */ + + + /*On x11, Put the note on all workspaces or move it if necessary. + *We can't yet change workspace on wayland + */ + GdkScreen *screen = gdk_screen_get_default(); + if (!(GDK_IS_X11_DISPLAY (gdk_screen_get_display (screen)))) + return; + if (g_settings_get_boolean (stickynotes->settings, "sticky")) gtk_window_stick (GTK_WINDOW (note->w_window)); -- cgit v1.2.1