Skip to content

Commit

Permalink
PanFrames: update global state consistently
Browse files Browse the repository at this point in the history
When paging is initiated through the use of panframes, they are mapped
and unmapped accordingly.  When `DesktopConfiguration` is in `global`
mode (the default), the global state aggregated across all monitors is
updated.

This update didn't include the state of panwindows, which meant that
once someone had caused paging to happen enough time, panframes which
should have been mapped weren't.

Fixes #459
  • Loading branch information
ThomasAdam committed Mar 7, 2021
1 parent 2b613ae commit 2655080
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
26 changes: 15 additions & 11 deletions fvwm/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,7 @@ void checkPanFrames(struct monitor *m)
bool do_unmap_r = false;
bool do_unmap_t = false;
bool do_unmap_b = false;
bool global = (monitor_mode == MONITOR_TRACKING_G);
struct monitor *mcur;

if (!Scr.flags.are_windows_captured)
Expand All @@ -987,6 +988,11 @@ void checkPanFrames(struct monitor *m)
}

{
int h = global ? monitor_get_all_heights() : (m->si->y + m->si->h);
int w = global ? monitor_get_all_widths() : (m->si->x + m->si->w);
int x = global ? 0 : m->si->x;
int y = global ? 0 : m->si->y;

/* Remove Pan frames if paging by edge-scroll is permanently or
* temporarily disabled */
if (m->virtual_scr.EdgeScrollX == 0 || m->virtual_scr.VxMax == 0)
Expand Down Expand Up @@ -1056,7 +1062,7 @@ void checkPanFrames(struct monitor *m)
{
XResizeWindow(
dpy, m->PanFrameLeft.win, edge_thickness,
m->si->y + m->si->h);
h);
}
if (!m->PanFrameLeft.isMapped)
{
Expand All @@ -1079,9 +1085,8 @@ void checkPanFrames(struct monitor *m)
{
XMoveResizeWindow(
dpy, m->PanFrameRight.win,
(m->si->x + m->si->w) - edge_thickness,
m->si->y,
edge_thickness, (m->si->y + m->si->h));
w - edge_thickness,
y, edge_thickness, h);
}
if (!m->PanFrameRight.isMapped)
{
Expand All @@ -1102,10 +1107,8 @@ void checkPanFrames(struct monitor *m)
{
if (edge_thickness != last_edge_thickness)
{
XResizeWindow(
dpy, m->PanFrameTop.win,
(m->si->x + m->si->w),
edge_thickness);
XResizeWindow( dpy, m->PanFrameTop.win, w,
edge_thickness);
}
if (!m->PanFrameTop.isMapped)
{
Expand All @@ -1127,9 +1130,9 @@ void checkPanFrames(struct monitor *m)
if (edge_thickness != last_edge_thickness)
{
XMoveResizeWindow(
dpy, m->PanFrameBottom.win, m->si->x,
(m->si->y + m->si->h) - edge_thickness,
(m->si->x + m->si->w), edge_thickness);
dpy, m->PanFrameBottom.win, x,
h - edge_thickness,
w, edge_thickness);
}
if (!m->PanFrameBottom.isMapped)
{
Expand All @@ -1140,6 +1143,7 @@ void checkPanFrames(struct monitor *m)

}
last_edge_thickness = edge_thickness;
monitor_assign_virtual(m);
}

/*
Expand Down
4 changes: 4 additions & 0 deletions libs/FScreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ monitor_assign_virtual(struct monitor *ref)
continue;

memcpy(&m->virtual_scr, &ref->virtual_scr, sizeof(m->virtual_scr));
memcpy(&m->PanFrameTop, &ref->PanFrameTop, sizeof(m->PanFrameTop));
memcpy(&m->PanFrameLeft, &ref->PanFrameLeft, sizeof(m->PanFrameLeft));
memcpy(&m->PanFrameRight, &ref->PanFrameRight, sizeof(m->PanFrameRight));
memcpy(&m->PanFrameBottom, &ref->PanFrameBottom, sizeof(m->PanFrameBottom));
}
}

Expand Down

0 comments on commit 2655080

Please sign in to comment.