Bug 475165

Summary: Firefox 118 w/ fractional scaling enabled: Context menus and hints are misplaced or not rendered with the correct size
Product: [Plasma] kwin Reporter: postix <postix>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: kde, michel
Priority: NOR Keywords: wayland-only
Version First Reported In: 5.27.8   
Target Milestone: ---   
Platform: Other   
OS: Linux   
URL: https://bugzilla.mozilla.org/show_bug.cgi?id=1849109
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screen recording

Description postix 2023-10-03 10:23:09 UTC
Created attachment 162046 [details]
Screen recording

SUMMARY

Firefox 118 has a new feature to account for fractional scaling. While this sharpens the text, right-click context menus or hints (on mouse hover) are placed at a wrong position or not rendered with the correct size.

I am not sure if this is a kwin or a Firefox bug.

STEPS TO REPRODUCE
1.  Firefox 118
2.  about:config -> set widget.wayland.fractional-scale.enabled to true and restart the FF
3. Go to https://invent.kde.org/plasma/systemsettings/-/issues/15#note_775149
    Hover the mouse over the reactions
4. Right click somewhere in Firefox to open the context menu: Often it looks right, but in some cases the issue appears, so try it several times.

OBSERVED RESULT
Please see the screen recording

EXPECTED RESULT
Context menus and hints are always opened at the cursor position and have a useful size, just as when having fractional scaling disabled in Firefox's advanced config.


SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 38
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.109.0
Qt Version: 5.15.10
Kernel Version: 6.5.5-200.fc38.x86_64 (64-bit)
Graphics Platform: Wayland
Firefox 118

ADDITIONAL INFORMATION
Scaling: 1.25
Comment 1 postix 2023-10-03 15:28:16 UTC
I have noticed that the context menu issues also appear with an integer scaling factor of 2.0 on Plasma's side, when enabling fractional scaling in FF.
Comment 2 David Edmundson 2023-10-04 12:47:06 UTC
>Often it looks right, but in some cases the issue appears, so try it several times.

I can reproduce.

I ran with WAYLAND_DEBUG=1 the xdg_positioner.set_anchor_rect changes between these broken and correct cases even when clicking on the same place. That's a firefox bug, clearly there's a path that mixes up co-ordinates.

Can you report to Firefox and link here?
Let me know if not and I'll do it.
Comment 3 postix 2023-10-04 13:25:44 UTC
> Can you report to Firefox and link here?
Sure, done. :)
Comment 4 Michel Le Bihan 2023-10-07 09:24:05 UTC
The issue was already reported in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1849109