Open Bug 1817387 Opened 3 years ago Updated 8 months ago

[Wayland] Autoscroll icon appears in the wrong location

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 110
defect

Tracking

()

UNCONFIRMED

People

(Reporter: brandon.cooper, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

Attached video 2023-02-16 23-16-25.mkv —

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0

Steps to reproduce:

Launched Firefox with MOZ_ENABLE_WAYLAND=1 then attempted to use middle-mouse click after enabling general.autoScroll in about:config.

Actual results:

Autoscroll works, however the icon for it appears about 300px below the cursor and is unable to go above a certain height on the main screen. On the secondary screen, the icon still appears at the same distance below the cursor, however it is not limited to (roughly) the bottom half of the screen.

Expected results:

Autoscroll icon should appear directly under the cursor after using middle-mouse click.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

Please attach your about:support page. Is that a recent regression?
Thanks.

Flags: needinfo?(brandon.cooper)
Priority: -- → P3
Attached file about:support —
Flags: needinfo?(brandon.cooper)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #2)

Please attach your about:support page. Is that a recent regression?
Thanks.

This isn't a recent regression as far as I'm aware. My system was recently setup to use Wayland on AMD. Previously I was using X11 on Nvidia.

I see you use multi-monitor setup on KDE. I wonder if that's the factor here.

(In reply to Martin Stránský [:stransky] (ni? me) from comment #5)

I see you use multi-monitor setup on KDE. I wonder if that's the factor here.

FWIW I can reproduce this on both KDE and Sway (I can try Gnome if you can't reproduce it). With my personal configuration:

MOZ_ENABLE_WAYLAND=0 on KDE and Sway with single monitor: works
MOZ_ENABLE_WAYLAND=1 on KDE and Sway with single monitor: works
MOZ_ENABLE_WAYLAND=0 on KDE and Sway with 2 monitors: works
MOZ_ENABLE_WAYLAND=1 on KDE and Sway with 2 monitors: doesn't work

I can also reproduce this on a single monitor if I mess around with the single screen's position and disable the second monitor.

Specifically, if I set the screen to the (x,y) position of (a,b), then with MOZ_ENABLE_WAYLAND=1:

Vertical autoscroll icon is bounded to b and y_max in FF window y-coordinate (i.e. it can't appear within b pixels of top of FF window).
Horizontal autoscroll icon is bounded to a and x_max in FF window x-coordinate (i.e. it can't appear within a pixels of left of FF window).

Is there any more info you need to track this down?

(In reply to Alex from comment #6)

Specifically, if I set the screen to the (x,y) position of (a,b), then with MOZ_ENABLE_WAYLAND=1:

How do you set that? Is there any KDE option for it?
Thanks.

Flags: needinfo?(hoolumbian)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #7)

(In reply to Alex from comment #6)

Specifically, if I set the screen to the (x,y) position of (a,b), then with MOZ_ENABLE_WAYLAND=1:

How do you set that? Is there any KDE option for it?

I tried force setting it in KDE via the ~/.local/share/kscreen/<UUID> file, but Kwin appears to force the single screen back to (0,0) a moment after startup.

Sway, however, allows setting the position of a single screen inside its ~/.config/sway/config file. For example, for a single monitor at pos (200,400), add the line:
output DP-1 position 200,400
where DP-1 is the identifier associated with your monitor connection and can be queried via swaymsg -t get_outputs.

Note that this is just for testing with a single monitor to simulate behaviour found in multi-monitor configs. If you have 2 monitors, then in KDE you can test this by setting up monitors placements in System Settings->Display Configuration and viewing the results in the aforementioned ~/.local/share/kscreen/<UUID> file. You can have a primary monitor with non-zero (x,y) by having the secondary monitor have a top-left point to the left and/or above the primary monitor's. For example, my current configuration has a position of (0,600) for my primary and (1920,0) for my secondary (rotated) monitor.

Other notes: apparently with the monitor position being (0,1920) (below my rotated secondary monitor) the icon is bound to x-coord b/w 0 and 1080 (width of secondary monitor). I have also had the icon appear on the other monitor entirely a few times, but I can't seem to find a 100% reliable reproduction for that (the icon is fixed a few pixels off the edge of the secondary monitor). One setup it happens in is when my primary is at (0,840) and my secondary is at (1920,0) and autoscrolling more than ~1260 pixels in FF window x-coord.

P.S. I don't know why I separated vertical/horizontal autoscroll in my previous post -- they are both bound similarly in both x/y coordinates.

Flags: needinfo?(hoolumbian)

(In reply to Alex from comment #8)

Other notes: apparently with the monitor position being (0,1920) (below my rotated secondary monitor)

Sorry, I meant to specify that in addition to the above, the secondary monitor here is at (0,0); i.e. the left edges are aligned with my primary monitor being on bottom.

I've posted my current monitor configuration for clarification: my main monitor is at position (0,600) which results in an autoscroll action in Firefox window y-coordinates between 0 and 600 showing an autoscroll icon at FF y-coordinate 600.

I have the same issue on Hyprland. It occurs when I have one monitor connected, but also when I have 2 other monitors connected.

If I press the middle mouse button on the left 3/4s of the screen, Firefox will always display it at the exact same horizontal position. If I press it anywhere in the right fourth of the screen, it will display correctly.

Comment on attachment 9337349 [details]
Video of example on Hyprland (one monitor)

Forgot to mention: my screen resolution is 2560x1600, not sure if that matters.

This issue also seems to occur with fractional scaling on Wayland on a single-monitor setup, where if my desktop is scaled to anything between 100% and 200%, the autoscroll icon only appears within a small section of the screen in the top left, the section that would appear if the desktop was scaled to 200%. Tested on KDE Plasma 6 and Hyprland on Fedora

Same issue on Fedora 41 KDE with Wayland on 1920x1080 display with 125% fractional scaling.

I have a similar issue using labwc (iirc behavior is the same on sway) with two monitors, one 1920x1080 and 100% scaling at (0, 0) and the other 3840x2160 and 200% scaling at (1920, 0). The autoscroll icon works correctly on the 100% monitor but on the 200% one it gets clamped inside the upper left quadrant of the monitor. The issue only occurs when the left edge of window is within ~25px from the edge of the monitor. Moving the window slightly to the right from there stops the issue. This issue seems to be the same with any scale factor other than 100% (I tested 101% and 300%), with the icon still restricted to the same portion of the screen.

A successful workaround I found is shifting the monitor positions to (-1920, 0) and (0, 0), with the same relative positioning.

Simply removing the clamping of popupX and popupY here fixes the issue for me:
https://github.com/mozilla-firefox/firefox/blob/4960eb24f62c92a9f1b34eefe114e0916fb1e916/toolkit/content/widgets/browser-custom-element.mjs#L1479
However I'm unsure what the original purpose of the clamping is so I don't know if this causes other issues.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: