Skip to content

Commit

Permalink
GotoPage: inject current screen if missing
Browse files Browse the repository at this point in the history
When invoking the GotoPage command such as:

    GotoPage 0 0

... this would be invalid because the first argument is treated as a
screen identifier, which then fails the rest of the command.

In such cases, inject the screen name of the current monitor if it's
missing.

Fixes #941
  • Loading branch information
ThomasAdam committed Jan 6, 2024
1 parent a7bfea6 commit 106d7f9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions fvwm/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -1831,6 +1831,20 @@ Bool get_page_arguments(
limitdeskx = 1;
limitdesky = 1;

/* We've received something like:
*
* GotoPage 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

0 comments on commit 106d7f9

Please sign in to comment.