Skip to content

Commit

Permalink
initPanFrames: guard mapped panframes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ThomasAdam committed Jun 21, 2021
1 parent 830c67d commit 31c2dbc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fvwm/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down Expand Up @@ -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*/
Expand Down Expand Up @@ -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");
}

Expand Down

0 comments on commit 31c2dbc

Please sign in to comment.