Skip to content

Commit

Permalink
FvwmPager: honour screen focus rules
Browse files Browse the repository at this point in the history
When FvwmPager is configured without the `Monitor` module config line,
*and*, `DesktopConfiguration per-monitor` is set, FvwmPager wasn't
tracking which monitor should be used to invoke the `GotoDesk` command
when clicking on the pager desk label.

This meant desktops had the effect of not switching.

This change won't affect `DesktopConfiguration global`, and will work
when FvwmPager has a `Monitor` configuration line.

Fixes #957
  • Loading branch information
ThomasAdam committed Mar 15, 2024
1 parent 7d68bd2 commit 89eb0ba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
3 changes: 2 additions & 1 deletion fvwm/update.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ Bool update_fvwm_monitor(FvwmWindow *fw)
EWMH_SetCurrentDesktop(fw->m);
desk_add_fw(fw);
BroadcastConfig(M_CONFIGURE_WINDOW, fw);
BroadcastMonitorList(NULL);

return True;
}
Expand Down Expand Up @@ -785,4 +786,4 @@ void CMD_UpdateStyles(F_CMD_ARGS)
}

return;
}
}
16 changes: 3 additions & 13 deletions modules/FvwmPager/FvwmPager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1555,21 +1555,16 @@ void list_config_info(unsigned long *body)
DrawGrid(val, True, None, NULL);
} else if (StrEquals(token, "Monitor")) {
char *mname;
int updated = 0;

tline = GetNextToken(tline, &mname);

TAILQ_FOREACH(m2, &fp_monitor_q, entry) {
updated = 0;
if (strcmp(m2->name, mname) == 0) {
extract_monitor_config(m2,tline);
updated = 1;
return;
}
}

if (updated)
return;

m = fxcalloc(1, sizeof(*m));

m->name = fxstrdup(mname);
Expand Down Expand Up @@ -1863,21 +1858,16 @@ ImagePath = NULL;
}
else if (StrEquals(token, "Monitor")) {
char *mname;
int updated = 0;

next = GetNextToken(next, &mname);

TAILQ_FOREACH(m2, &fp_monitor_q, entry) {
updated = 0;
if (strcmp(m2->name, mname) == 0) {
extract_monitor_config(m2, next);
updated = 1;
return;
}
}

if (updated)
continue;

m = fxcalloc(1, sizeof(*m));

m->name = fxstrdup(mname);
Expand Down Expand Up @@ -2463,4 +2453,4 @@ void ExitPager(void)
}
XUngrabKeyboard(dpy, CurrentTime);
exit(0);
}
}
5 changes: 2 additions & 3 deletions modules/FvwmPager/x_pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1898,8 +1898,7 @@ void SwitchToDesk(int Desk)
struct fpmonitor *m = fpmonitor_this();

snprintf(command, sizeof(command),
"GotoDesk %s 0 %d", monitor_to_track ? m->name : "",
Desk + desk1);
"GotoDesk %s 0 %d", m->name, Desk + desk1);
SendText(fd,command,0);
}

Expand Down Expand Up @@ -3427,4 +3426,4 @@ void change_colorset(int colorset)
}

return;
}
}

0 comments on commit 89eb0ba

Please sign in to comment.