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

'GotoPage <number> <number>' no longer works, including from FvwmPager #941

Closed
siebenmann opened this issue Jan 3, 2024 · 4 comments · Fixed by #942
Closed

'GotoPage <number> <number>' no longer works, including from FvwmPager #941

siebenmann opened this issue Jan 3, 2024 · 4 comments · Fixed by #942
Assignees
Labels
type:bug Something's broken!
Milestone

Comments

@siebenmann
Copy link

Upfront Information

Please provide the following information by running the command and providing
the output.

  • Fvwm3 version (run: fvwm3 --version): the latest Git tip, a7bfea6

  • Linux distribution or BSD name/version: Fedora 38

  • Platform (run: uname -sp): 'Linux unknown', aka x86-64

Issue

After I updated to the latest Git tip (plus some personal patches that I don't believe are relevant), I found that clicking on virtual screens in my FvwmPagers didn't work. On investigating the debug log, messages such as '[1704300520.875071] CMD_GotoPage: GotoPage: invalid arguments: 1 0' were being logged. Investigation showed that all uses of GotoPage of the form 'GotoPage X Y' were failing, but 'GotoPage -1 -1' and similar negative numbers worked. It appears that 'GotoPage X@0 Y@0' works, but this may be an accidental side effect.

My configuration has two screens side by side:

Screen 0: minimum 320 x 200, current 7680 x 2160, maximum 16384 x 16384
DisplayPort-0 connected 3840x2160+3840+0 (normal left inverted right x axis y axis) 597mm x 336mm
[...]
HDMI-A-0 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 597mm x 336mm
[...]

This worked in an older Git version but I'm not sure how old. Based on my reflog, the version I last had working is either 058b6ab or 6559365.

(In the process of looking at this, I noticed that GotoPage also accepts a 'w' modifier on the numbers that doesn't seem to currently be documented, unless I missed something there.)

@siebenmann siebenmann added the type:bug Something's broken! label Jan 3, 2024
@ThomasAdam ThomasAdam added this to the 1.1.0 milestone Jan 3, 2024
@ThomasAdam ThomasAdam added this to FVWM3 Jan 3, 2024
@github-project-automation github-project-automation bot moved this to To do in FVWM3 Jan 3, 2024
@ThomasAdam ThomasAdam self-assigned this Jan 3, 2024
@siebenmann
Copy link
Author

Looking at the code changes I think I see what may be happening here. As part of 245648f, monitor_resolve_name() was changed to accept bare numbers as monitor numbers. CMD_GotoPage() starts by calling get_page_arguments(), which in turn starts by calling monitor_resolve_name(). When invoked as 'GotoPage X Y' for X and Y being simple numbers, before this change monitor_resolve_name() would not find a monitor number and pass, so get_page_arguments() would use the current monitor and go on to parse both arguments as x and y pages indexes. After this change, monitor_resolve_name() parses the first number (X) as a monitor number, leaving only one argument for the rest of get_page_arguments(), which is invalid. As a test I tried 'GotoPage 0 X Y' and that seems to work.

This explains why 'GotoPage X@0 Y@0' works; it causes monitor_resolve_name() to pass because the argument it's passed isn't a number (or anything else it accepts).

@ThomasAdam
Copy link
Member

Yes. It's easily fixed. I'll do so momentarily.

ThomasAdam added a commit that referenced this issue Jan 3, 2024
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
@ThomasAdam
Copy link
Member

Hey @siebenmann

#942 fixes this for me. Can you confirm?

@siebenmann
Copy link
Author

#942 seems to fix it for me. Everything works from what I can see, both tests and FvwmPager.

ThomasAdam added a commit that referenced this issue Jan 6, 2024
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
@github-project-automation github-project-automation bot moved this from To do to Done in FVWM3 Jan 6, 2024
ThomasAdam added a commit that referenced this issue Mar 15, 2024
When invoking the GotoDesk or GotoDeskAndPage commands such as:

    GotoDesk 0 0
    GotoDeskAndPage 0 0 1

... 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
Fixes #957
ThomasAdam added a commit that referenced this issue Mar 15, 2024
When invoking the GotoDesk or GotoDeskAndPage commands such as:

    GotoDesk 0 0
    GotoDeskAndPage 0 0 1

... 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
Fixes #957
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something's broken!
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants