From 513e2b4f5ce50ca306f9b3f52387cb955d844ef2 Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Sun, 9 Aug 2020 22:46:57 +0200
Subject: [PATCH] fix segfault when using under wayland

---
 src/working-area.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/working-area.c b/src/working-area.c
index 86a1fa5..36c5e48 100644
--- a/src/working-area.c
+++ b/src/working-area.c
@@ -42,6 +42,10 @@ static gboolean gf_display_get_workarea(GdkScreen* g_screen, GdkRectangle *rect)
 	GdkDisplay *g_display;
 	Screen *x_screen;
 
+	/* avoid touching X stuff when using wayland */
+	if (g_getenv("WAYLAND_DISPLAY"))
+		return FALSE;
+
 	/* get the gdk display */
 	g_display = gdk_display_get_default();
 	if(!g_display)
-- 
2.28.0

