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

Fix GotoDeskAndPage #837

Merged
merged 2 commits into from
Apr 2, 2023
Merged
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
16 changes: 4 additions & 12 deletions fvwm/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -2565,6 +2565,7 @@ void CMD_Desk(F_CMD_ARGS)
void CMD_GotoDeskAndPage(F_CMD_ARGS)
{
int val[3];
int current_desk;
Bool is_new_desk;
char *next;
char *token;
Expand Down Expand Up @@ -2598,6 +2599,7 @@ void CMD_GotoDeskAndPage(F_CMD_ARGS)
return;
}

current_desk = m->virtual_scr.CurrentDesk;
is_new_desk = (m->virtual_scr.CurrentDesk != val[0]);

if (is_tracking_shared && is_new_desk) {
Expand All @@ -2606,14 +2608,11 @@ void CMD_GotoDeskAndPage(F_CMD_ARGS)
UnmapDesk(m, m->virtual_scr.CurrentDesk, True);
CMD_GOTO_DESK(m, val[0]);
}
m->virtual_scr.prev_desk_and_page_page_x = m->virtual_scr.Vx;
m->virtual_scr.prev_desk_and_page_page_y = m->virtual_scr.Vy;
MoveViewport(m, val[1], val[2], True);
if (is_new_desk)
{
m->virtual_scr.prev_desk = m->virtual_scr.CurrentDesk;
m->virtual_scr.prev_desk_and_page_desk = m->virtual_scr.CurrentDesk;
m->virtual_scr.CurrentDesk = val[0];
m->virtual_scr.prev_desk = current_desk;
m->virtual_scr.prev_desk_and_page_desk = current_desk;

/* If we're in global mode, store the virtual_scr across all
* monitors. This will allow for per-monitor tracking to be
Expand All @@ -2632,8 +2631,6 @@ void CMD_GotoDeskAndPage(F_CMD_ARGS)
if (is_tracking_shared)
goto done;

BroadcastPacket(M_NEW_DESK, 2, (long)m->virtual_scr.CurrentDesk,
(long)m->si->rr_output);
/* FIXME: domivogt (22-Apr-2000): Fake a 'restack' for sticky
* window upon desk change. This is a workaround for a
* problem in FvwmPager: The pager has a separate 'root'
Expand All @@ -2645,11 +2642,6 @@ void CMD_GotoDeskAndPage(F_CMD_ARGS)
* pager doesn't the stacking order. */
BroadcastRestackAllWindows();
}
else
{
BroadcastPacket(M_NEW_DESK, 2, (long)m->virtual_scr.CurrentDesk,
(long)m->si->rr_output);
}
done:
BroadcastMonitorList(NULL);
EWMH_SetCurrentDesktop(m);
Expand Down