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

GotoDesk: fallback to current monitor if not given #966

Merged
merged 1 commit into from
Mar 20, 2024
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
18 changes: 3 additions & 15 deletions fvwm/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -2563,33 +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)
{
action = next;
}
else
{
if (m == NULL) {
m = monitor_get_current();
next = action;
}

new_desk = GetDeskNumber(m, action, m->virtual_scr.CurrentDesk);
new_desk = GetDeskNumber(m, next, m->virtual_scr.CurrentDesk);

if (is_tracking_shared) {
/* Check to see if this monitor is requesting a desktop which
Expand Down
Loading