From 31c2dbcb36b7b40711545ee8dccf3b926db53d89 Mon Sep 17 00:00:00 2001 From: Thomas Adam Date: Sun, 20 Jun 2021 14:53:37 +0100 Subject: [PATCH] initPanFrames: guard mapped panframes initPanFrames() can be called from a few different commands to ensure panframes are mapped. Since there's no way of knowing which command will initiate the panframes, guard against this so we don't end up unmapping the panframes. Fixes #543 --- fvwm/virtual.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fvwm/virtual.c b/fvwm/virtual.c index d237a49c5..b279f36b9 100644 --- a/fvwm/virtual.c +++ b/fvwm/virtual.c @@ -109,6 +109,7 @@ */ static int edge_thickness = 2; static int last_edge_thickness = 2; +static bool pan_frames_mapped = false; static void store_desktop_cmd(int, char *); static int number_of_desktops(struct monitor *); @@ -1288,6 +1289,9 @@ void initPanFrames(void) int saved_thickness; struct monitor *m; + if (pan_frames_mapped) + return; + /* Not creating the frames disables all subsequent behavior */ /* TKP. This is bad, it will cause an XMap request on a null window * later*/ @@ -1340,6 +1344,7 @@ void initPanFrames(void) checkPanFrames(m); } edge_thickness = saved_thickness; + pan_frames_mapped = true; fvwm_debug(__func__, "finished setting up per-monitor panframes"); }