Open Bug 1715671 Opened 5 years ago Updated 1 month ago

Autoscrolling circle does not appear on correct display on KDE X11

Categories

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

Firefox 89
defect

Tracking

()

UNCONFIRMED

People

(Reporter: mozilla, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: gtk-severity-sweep-2026-10)

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

Steps to reproduce:

Enabled the autoscrolling feature on KDE Plasma 5.22 X11 with two monitors (one monitor to the left, another to the right). I then middle click the mouse on my non-primary screen to the right.

Actual results:

The autoscrolling circle does not appear where I click on the right monitor, it instead appears on the right edge of the left monitor.

Expected results:

The autoscrolling circle should appear on the same monitor as clicked.

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

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Blocks: gtk-kde
Priority: -- → P3

Hi, is this using hidpi (2x) scaling? I can reproduce this in hidpi, but not normal scaling. Just trying to confirm it's the same issue.

Flags: needinfo?(mozilla)

Yes, I am using 2.5x display scaling.

Flags: needinfo?(mozilla)

I have the same issue. I'm not on KDE, but on Cinnamon.
Some more info:
The grade of displacement seems to depend of the grade of fractional scaling on Cinnamon.
E.g. my setup: the left monitor is 1080p, the right one is 4K, HiDPI-scaling is set to double, with additional per-monitor scaling for the 1080p one on the left (set to 100%). In that case, it doesn't matter where on the right monitor I middle-click, it always displays on the left monitor.
If I disable the per-monitor-scaling, I click on the left half of the right monitor and it displays on the left monitor. If I click on the right half of the right monitor, it displays where it should be.
The point of display-change varies depending on the amount of per-monitor-scaling. With 173% on the left monitor, I have to go to a little further to the right.
How far I have to go to the right can be calculated: width of the right monitor / fractional scaling.
e.g. native width of the right monitor: 3840 px, 150% scaling on the left monitor, HiDPI scaling set to double (X11, so HiDPI applies to both monitors) results in the following: I have to go x-coordinate (3840 / 1.5) = 2560 on the right monitor for the scroll indicator to be displayed correctly (maybe to 2561, hard to tell on a 4K display ;) )

It all comes down to https://hg.mozilla.org/mozilla-unified/file/tip/toolkit/content/widgets/browser-custom-element.js#l1329 ff
There, the screen's workarea is divided by the scale factor. The event coordinates however include the scale factor, so the division is not needed. Removing the division by scale factor fixes this issue (at least on my machine). The autoscroll indicator is then positioned correctly no matter if you use fractional scaling via xrandr or Gtk HiDPI or both or none.

Severity: -- → S3
Whiteboard: gtk-severity-sweep-2026-10
You need to log in before you can comment on or make changes to this bug.