From a2b794394901ab1fc5fcf7875c4ad73aa3ba6f1b Mon Sep 17 00:00:00 2001 From: Valentin Villenave Date: Thu, 7 Oct 2021 11:08:34 +0200 Subject: =?UTF-8?q?Mate=20Sticky=20notes=20applet:=20fix=20segfault=20when?= =?UTF-8?q?=20Caja=20isn=E2=80=99t=20running?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stickynotes/stickynotes_applet_callbacks.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'stickynotes') diff --git a/stickynotes/stickynotes_applet_callbacks.c b/stickynotes/stickynotes_applet_callbacks.c index 7b454f5b..c0889df2 100644 --- a/stickynotes/stickynotes_applet_callbacks.c +++ b/stickynotes/stickynotes_applet_callbacks.c @@ -172,6 +172,12 @@ void install_check_click_on_desktop (void) window = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (), desktop_window); + /* Avoid crash if the desktop window ID is set but invalid, e.g. if + * Caja has set it but quit since then */ + if (!window) { + return; + } + /* It may contain an atom to tell us which other window to monitor */ user_time_window = gdk_x11_get_xatom_by_name ("_NET_WM_USER_TIME_WINDOW"); user_time = gdk_x11_get_xatom_by_name ("_NET_WM_USER_TIME"); -- cgit v1.2.1