Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PanFrame improvements #547

Merged
merged 6 commits into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion fvwm/fvwm3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,10 @@ void StartupStuff(void)
}
/* Have to do this here too because preprocessor modules have not run
* to the end when HandleEvents is entered from the main loop. */
initPanFrames();
struct monitor *m;
TAILQ_FOREACH(m, &monitor_q, entry)
checkPanFrames(m);

fFvwmInStartup = False;

/* Make sure the geometry window uses the current font */
Expand Down
35 changes: 23 additions & 12 deletions fvwm/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@
*/
static int edge_thickness = 2;
static int last_edge_thickness = 2;
static bool pan_frames_mapped = false;

static void checkPanFrames(struct monitor *);
static void store_desktop_cmd(int, char *);
static int number_of_desktops(struct monitor *);
static void init_one_panframe(PanFrame *, int, int, int, int, int);
Expand Down Expand Up @@ -1083,6 +1083,18 @@ void checkPanFrames(struct monitor *m)
do_unmap_b = true;
}

/* Remove panframes if in global mode and on inside edge */
if (global) {
if (m->edge.left)
do_unmap_l = true;
if (m->edge.right)
do_unmap_r = true;
if (m->edge.bottom)
do_unmap_b = true;
if (m->edge.top)
do_unmap_t = true;
}

/* correct the unmap variables if pan frame commands are set */
if (edge_thickness != 0) {
if (m->PanFrameLeft.command != NULL ||
Expand All @@ -1102,17 +1114,6 @@ void checkPanFrames(struct monitor *m)
do_unmap_t = false;
}
}
/* Remove panframes if in global mode and on inside edge */
if (global) {
if (m->edge.left)
do_unmap_l = true;
if (m->edge.right)
do_unmap_r = true;
if (m->edge.bottom)
do_unmap_b = true;
if (m->edge.top)
do_unmap_t = true;
}

/*
* hide or show the windows
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 Expand Up @@ -1962,6 +1967,8 @@ void CMD_EdgeCommand(F_CMD_ARGS)
if (action != NULL)
actdup = fxstrdup(action);

initPanFrames();

/* get the direction */
direction = gravity_parse_dir_argument(action, &action, DIR_NONE);

Expand Down Expand Up @@ -2017,6 +2024,7 @@ void CMD_EdgeCommand(F_CMD_ARGS)
fvwm_debug(__func__,
"Internal error in CMD_EdgeCommand");
}
checkPanFrames(m);
}
free(command);
free(actdup);
Expand All @@ -2037,6 +2045,8 @@ void CMD_EdgeLeaveCommand(F_CMD_ARGS)
if (action != NULL)
actdup = fxstrdup(action);

initPanFrames();

/* get the direction */
direction = gravity_parse_dir_argument(action, &action, DIR_NONE);

Expand Down Expand Up @@ -2088,6 +2098,7 @@ void CMD_EdgeLeaveCommand(F_CMD_ARGS)
/* this should never happen */
fvwm_debug(__func__, "Internal error");
}
checkPanFrames(m);
}
free(command);
free(actdup);
Expand Down
1 change: 1 addition & 0 deletions libs/FScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ int monitor_get_all_widths(void);
int monitor_get_all_heights(void);
void monitor_add_new(void);
void monitor_assign_virtual(struct monitor *);
void checkPanFrames(struct monitor *);

#define FSCREEN_MANGLE_USPOS_HINTS_MAGIC ((short)-32109)

Expand Down