Skip to content

Commit

Permalink
GotoDeskAndPage: the prev argument never works
Browse files Browse the repository at this point in the history
An incorrect value is assigned to prev_desk_and_page_desk, which makes
`GotoDeskAndPage prev` never working as expected.
  • Loading branch information
shang authored and ThomasAdam committed Apr 2, 2023
1 parent 35c6933 commit a1e4ba5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 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 Down

0 comments on commit a1e4ba5

Please sign in to comment.