Skip to content

Commit

Permalink
FvwmPager: Update current desk correctly during init.
Browse files Browse the repository at this point in the history
When FvwmPager is tracking the current desk and is run on any desk
except desk 0, the current desk isn't updated during initialization
because the monitor update is sent before the desk update, so the
pager didn't realize the desk has changed.

This ensures that the pager updates the current desk if either
the desk changes or the new desk is not the same as the current
desk to also catch updates during pager initialization.

Fixes #1122
  • Loading branch information
somiaj committed Nov 30, 2024
1 parent 4f45e7c commit a8dda1c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/FvwmPager/messages.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,9 @@ void process_new_desk(unsigned long *body)
*/
oldDesk = fp->m->virtual_scr.CurrentDesk;
newDesk = fp->m->virtual_scr.CurrentDesk = (long)body[0];
if (newDesk >= desk1 && newDesk <= desk2)
if (fAlwaysCurrentDesk)
Desks[0].fp = fp;
else if (newDesk >= desk1 && newDesk <= desk2)
Desks[newDesk - desk1].fp = fp;

/* Only update FvwmPager's desk for the monitors being tracked.
Expand Down Expand Up @@ -454,7 +456,7 @@ void process_new_desk(unsigned long *body)
monitor_assign_virtual(fp->m);

/* If always tracking current desk. Update Desks[0]. */
if (fAlwaysCurrentDesk && oldDesk != newDesk)
if (fAlwaysCurrentDesk && (oldDesk != newDesk || desk1 != newDesk))
{
PagerWindow *t;

Expand Down

0 comments on commit a8dda1c

Please sign in to comment.