'GotoPage <number> <number>' no longer works, including from FvwmPager
Closed this issue · 4 comments
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.)
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).
Yes. It's easily fixed. I'll do so momentarily.
Hey @siebenmann
#942 fixes this for me. Can you confirm?
#942 seems to fix it for me. Everything works from what I can see, both tests and FvwmPager.