Bug 499039 - Maximising Chromium windows with CSD by dragging them to the top screen edge causes the window to render out-of-alignment with its actual controls (including a transparent top bar)
Summary: Maximising Chromium windows with CSD by dragging them to the top screen edge ...
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: Quick Tiling (other bugs)
Version First Reported In: git master
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 492232 501314 501904 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-01-23 06:45 UTC by yannick.framenau
Modified: 2025-06-25 10:05 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yannick.framenau 2025-01-23 06:45:44 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY
When snapping a window of Brave Browser (this could happen with other apps, but I have yet to find another) to the top of the screen by dragging it, it will sometimes bug out. This does not happen using the Super+Up key, nor with the maximize button. I'm not sure how to describe it well, but have attached a screen recording (ignore the poor cropping in the recording).

STEPS TO REPRODUCE
1. Open Brave Browser
2. Snap the window to the top using the mouse

OBSERVED RESULT
Buggy behaviour involving the top bar.

EXPECTED RESULT
The browser should tile without issues.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Kernel Version: 6.12.10-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-9700 CPU @ 3.00GHz
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 2060 SUPER/PCIe/SSE2

ADDITIONAL INFORMATION
Comment 1 Vlad Zahorodnii 2025-01-23 11:57:55 UTC
> Buggy behaviour involving the top bar.

Can you show a screenshot or a screencast?
Comment 2 yannick.framenau 2025-01-23 14:45:02 UTC
(In reply to Vlad Zahorodnii from comment #1)
> > Buggy behaviour involving the top bar.
> 
> Can you show a screenshot or a screencast?

My bad, I must have forgotten to upload it when making the report.
The file size is too large to upload here so here's a streaming link.
https://www.youtube.com/watch?v=cz81fe2je6c
I forgot to change the resolution in OBS hence the poor cropping.
Comment 3 John Kizer 2025-01-28 04:55:31 UTC
I can reproduce in general on Fedora KDE 41 with another Chromium browser window using client-side decorations, rather than the system title bar and borders (in my case, a Vivaldi web app window).

This doesn't occur with other GTK applications, so I'd suspect - but I'm not sure if - this is a downstream Chromium issue. It seems like it could be related to https://issues.chromium.org/issues/347038254 , although that bug seems to combine several different things into one ticket (and is stated as being resolved)?
Comment 4 yannick.framenau 2025-01-29 08:02:40 UTC
(In reply to John Kizer from comment #3)
> I can reproduce in general on Fedora KDE 41 with another Chromium browser
> window using client-side decorations, rather than the system title bar and
> borders (in my case, a Vivaldi web app window).
> 
> This doesn't occur with other GTK applications, so I'd suspect - but I'm not
> sure if - this is a downstream Chromium issue. It seems like it could be
> related to https://issues.chromium.org/issues/347038254 , although that bug
> seems to combine several different things into one ticket (and is stated as
> being resolved)?

I've found a fix here:
https://community.brave.com/t/moving-window-full-screen-issues-on-wayland/572800/3
Comment 5 yannick.framenau 2025-01-29 08:06:07 UTC
(In reply to yannick.framenau from comment #4)
> (In reply to John Kizer from comment #3)
> > I can reproduce in general on Fedora KDE 41 with another Chromium browser
> > window using client-side decorations, rather than the system title bar and
> > borders (in my case, a Vivaldi web app window).
> > 
> > This doesn't occur with other GTK applications, so I'd suspect - but I'm not
> > sure if - this is a downstream Chromium issue. It seems like it could be
> > related to https://issues.chromium.org/issues/347038254 , although that bug
> > seems to combine several different things into one ticket (and is stated as
> > being resolved)?
> 
> I've found a fix here:
> https://community.brave.com/t/moving-window-full-screen-issues-on-wayland/
> 572800/3

Actually, it seems this also removes the maximise and minimise buttons, so it's not a flawless fix.
Comment 6 John Kizer 2025-03-26 03:48:26 UTC
*** Bug 501314 has been marked as a duplicate of this bug. ***
Comment 7 John Kizer 2025-03-26 03:49:25 UTC
It might be notable here, the reporters of both this bug and https://bugs.kde.org/show_bug.cgi?id=499039 , and I, all have NVIDIA graphics cards.
Comment 8 John Kizer 2025-03-27 15:17:49 UTC
*** Bug 492232 has been marked as a duplicate of this bug. ***
Comment 9 John Kizer 2025-04-11 04:04:26 UTC
*** Bug 501904 has been marked as a duplicate of this bug. ***
Comment 10 Lenzoid 2025-04-23 11:52:22 UTC
Can confirm 
- NOT REPRODUCIBLE with chrome://flags #ozone-platform-hint: Wayland, or Auto (Restart of browser required)
- NOT REPRODUCIBLE with amdgpu machine with 6.3.4 (arch)
- NOT REPRODUCIBLE with Plasma Workspace at git-master AND NVIDIA gpu only.

- All Appearance styles in Chromium: (Settings > Appearance > Theme: {QT, Use Classic, Use GTK}) are affected.
- Happens quite randomly, averaging at every other time. Sometimes less often, sometimes more often.
- Binding "Maximize Window" to a hotkey is beneficial to reproduce this.

Stable Arch + plasma workspace git-master
Operating System: Arch Linux 
KDE Plasma Version: 6.3.80
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Kernel Version: 6.14.2-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700X3D 8-Core Processor
Memory: 32 GiB of RAM (31.3 GiB usable)
Graphics Processor: NVIDIA GeForce RTX 2070 SUPER
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7B85
System Version: 1.0

Conclusion:

Chromium version Version 135.0.7049.95 is affected, therefore it likely isn't https://issues.chromium.org/issues/347038254 since users confirmed the fix on an earlier build.

One Brave user said that the “Preferred Ozone Platform” to Wayland introduced him to other bugs, but I don't know what these are. Maybe that's the reason this option is still "experimental". Since this is exclusive to Chromium based browsers, I'm inclined to see this as an upstream issue.

I will check if this is reproducible in Gnome and then come back here.
Comment 11 Kai Krakow 2025-06-25 09:52:30 UTC
I have the feeling that this gets worse with either each Plasma update or each Chrome update.

Since I use different systems, here are some observations that I can share:

1. This happens only with the wayland session, X11 is not affected.
2. I've never seen this happening with Vivaldi (also a Chrome-based browser), only with Chrome (both use CSD).
3. If I enable system decorations (right-click Chrome title bar to enable system decorations, thus disabling CSD), the problem goes away.
4. It affects both PWA and full browser experience, with PWA seemingly more prone to showing the problem.
5. I've never seen this happening on my Intel iGPU systems also running wayland, only my NVIDIA systems.
6. All my system are multi monitor systems, I don't know if single monitor systems are affected.
7. My affected systems use VRR. OTOH, only my VRR systems use NVIDIA.

Sometimes, it now requires 10 to 20 tries using the maximize hotkey to correct the wrongly rendered monitor. And the effect became worse since some update: now the contents not only render by a vertical offset the size of the titlebar with a transparent surface above the contents, I'm now seeing a render offset to the left and top sometimes, with black surfaces rendering on the right and bottom.

I'm going to try the wayland platform hint but from my previous tests, this introduces other Chrome bugs and even stops some render acceleration falling back to software rendering (probably confirmed by Chrome no longer showing in nvidia-smi at all last time I tested that).
Comment 12 Kai Krakow 2025-06-25 10:01:42 UTC
(In reply to Kai Krakow from comment #11)
> I'm going to try the wayland platform hint but from my previous tests, this
> introduces other Chrome bugs and even stops some render acceleration falling
> back to software rendering (probably confirmed by Chrome no longer showing
> in nvidia-smi at all last time I tested that).

First observations from switching to platform hint = wayland:

1. nvidia-smi shows only 3 MB used
2. GPU acceleration seems to work meanwhile
3. The maximize bug is still there but very different

So the bug is still there but different:

If I maximize the Chrome window, it now properly renders but it sometimes maximizes to some arbitrary screen position instead of the full monitor. It changes its size to the monitor dimensions, tho.

So I think multi monitor usage may be part of the problem here.

And the rendering offset may be a separate issue only with xwayland.
Comment 13 Kai Krakow 2025-06-25 10:05:04 UTC
BTW, adding to my previous post: I thought wayland windows aren't supposed to position themselves somewhere specific.

So I wonder how Chrome sometimes positions "itself" to some arbitrary screen position when maximized. This shouldn't be possible and thus may be a bug in kwin or plasma when interacting with Chrome?