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

FvwmPager: honour screen focus rules #958

Merged
merged 2 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
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
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;
}
}
27 changes: 27 additions & 0 deletions fvwm/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -2563,7 +2563,21 @@ void CMD_GotoDesk(F_CMD_ARGS)
struct monitor *m, *m_loop;
char *next, *token;
int new_desk;
int val[2];

/* We've received something like:
*
* GotoDesk 0 0
*
* But no monitor token. Use the current monitor.
*/
if (GetIntegerArguments(action, NULL, val, 2) == 2) {
xasprintf(&action, "%s %d %d",
monitor_get_current()->si->name, val[0], val[1]);

val[0] = -1;
val[1] = -1;
}
token = PeekToken(action, &next);
m = monitor_resolve_name(token);
if (m != NULL)
Expand Down Expand Up @@ -2635,6 +2649,19 @@ void CMD_GotoDeskAndPage(F_CMD_ARGS)
char *token;
struct monitor *m;

/* We've received something like:
*
* GotoDeskAndPage 0 0
*
* But no monitor token. Use the current monitor.
*/
if (GetIntegerArguments(action, NULL, val, 2) == 2) {
xasprintf(&action, "%s %d %d",
monitor_get_current()->si->name, val[0], val[1]);

val[0] = -1;
val[1] = -1;
}
token = PeekToken(action, &next);
m = monitor_resolve_name(token);
if (m != NULL)
Expand Down
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;
}
}
Loading