Bug 502695 - Brave browser scales incorrectly when maximized to screen scaled to 75%
Summary: Brave browser scales incorrectly when maximized to screen scaled to 75%
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 6.3.4
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2025-04-11 22:12 UTC by unhappy-ending
Modified: 2025-04-18 16:42 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Brave maximized but scaled incorrectly (1.65 MB, image/png)
2025-04-11 22:19 UTC, unhappy-ending
Details

Note You need to log in before you can comment on or make changes to this bug.
Description unhappy-ending 2025-04-11 22:12:18 UTC
See title. I have 2 screens, the main one is 4K with scaling set to 150% and a second 1080p screen with scaling set to 75%. When starting Brave browser on the main screen, scaling and everything is fine. Maximizing the Brave window on the main screen is fine. If I move it to the secondary scree, and maximize it, it will only fill 75% of the screen. Moving the window between both screens will shrink the Brave browser window each time it moves from one to the other. 

STEPS TO REPRODUCE
1. Launch Brave on an Intel Arc system
2. Move between a 4K display and a 1080p display with unique scaling on each
3. Profit!

OBSERVED RESULT

Kwin seems to rescale the browser each time it moves between each screen. Won't maximize on the secondary screen proper.

EXPECTED RESULT

Proper scaling of the app between both screens.

ADDITIONAL INFORMATION

Operating System: Gentoo Linux 2.17
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.12.0
Qt Version: 6.9.0
Kernel Version: 6.14.1-clang (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 9 3950X 16-Core Processor
Memory: 7.7 GiB of RAM
Graphics Processor: Intel® Arc
Product Name: X570S PG Riptide

OpenGL core profile vendor: Intel
OpenGL core profile renderer: Mesa Intel(R) Arc(tm) A750 Graphics (DG2)
OpenGL core profile version: 4.6 (Core Profile) Mesa 25.0.3
OpenGL core profile shading language version: 4.60

env:
export QT3D_RENDERER=opengl      # opengl, rhi
export QSG_RHI_BACKEND=opengl # vulkan, metal, opengl, d3d11, d3d12
export QSG_RENDER_LOOP=threaded  # basic, threaded
Comment 1 unhappy-ending 2025-04-11 22:19:23 UTC
Created attachment 180186 [details]
Brave maximized but scaled incorrectly
Comment 2 unhappy-ending 2025-04-11 22:22:07 UTC
unset the following env variables:

export QT3D_RENDERER=opengl      # opengl, rhi
export QSG_RHI_BACKEND=opengl # vulkan, metal, opengl, d3d11, d3d12
export QSG_RENDER_LOOP=threaded  # basic, threaded

Plasma Renderer is set to defaults.

No change.
Comment 3 unhappy-ending 2025-04-11 22:33:28 UTC
Removed the Arc A750 and tested on a Nvidia RTX 3070. No change. Funny, this didn't used to happen. Not sure what changed other than adding the Arc GPU. I did have this problem about a year ago but at some point it went away, and now it's back.
Comment 4 unhappy-ending 2025-04-11 23:16:21 UTC
Tested both Intel i915 driver and xe driver. No difference.

Running Brave with --ozone-platform=x11 does not have this problem.
Comment 5 John Kizer 2025-04-14 04:18:53 UTC
Hi - without having multiple monitors myself that I could use to try to reproduce this, my guess would be that it's somehow related to this work in Chromium - leaving the link in case it helps with other research: https://issues.chromium.org/issues/336007385
Comment 6 unhappy-ending 2025-04-14 18:35:38 UTC
(In reply to John Kizer from comment #5)
> Hi - without having multiple monitors myself that I could use to try to
> reproduce this, my guess would be that it's somehow related to this work in
> Chromium - leaving the link in case it helps with other research:
> https://issues.chromium.org/issues/336007385

That gave me the idea to try Chromium's --force-device-scale-factor flag and setting it to 1 to enforce a 100% scale always. No difference. That got me wondering what happens if I change the display's scaling to something else and it turns out kscreen's scaling settings do actually matter here.

For example, if I set the 1080p monitor from 75% scaling to 100% and move the browser window between the two, it no longer re-scales Brave. It's only when the scaling for the monitor is less than 100%. When it's less than 100%, moving Brave will from the big monitor to the small one re-scales it to a smaller window, and then moving it back to the big one re-scales it smaller again, and moving it back again will re-scale it even smaller until there's a singularity in the universe.

What if both monitors are 100% or higher? Brave won't re-scale when moved between the two.
What if both monitors are 75%? Brave won't re-scale when moved between them.
What if 4K is 50% and 1080p is 75%? Brave will re-scale between the two.

I didn't notice this before, but when Brave is on a monitor that has less than 100% scaling, grabbing it by the corner to resize results in a phantom window that you're pulling from and it re-scales the visible parts smaller than the actual window.
Comment 7 Nate Graham 2025-04-16 17:15:53 UTC
Does the same issue if you have only a single screen and it's scaled to 75%?
Comment 8 John Kizer 2025-04-16 17:52:26 UTC
Updating status since this is pending some information from the reporter, thanks!
Comment 9 unhappy-ending 2025-04-16 22:18:56 UTC
(In reply to Nate Graham from comment #7)
> Does the same issue if you have only a single screen and it's scaled to 75%?

Yes. Since I didn't have another screen I could bounce Brave between I did the corner drag test and it had the phantom window issue.