Bug 460686 - Maximized Qt applications' close buttons don't extend to corner completely
Summary: Maximized Qt applications' close buttons don't extend to corner completely
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.26.1
Platform: Archlinux Linux
: VHI normal (vote)
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2022-10-18 22:04 UTC by Kody
Modified: 2022-10-25 17:40 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.26.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kody 2022-10-18 22:04:20 UTC
SUMMARY
Using the (dark) Breeze theme with the close, maximize, and minimize buttons in the default top right position, when I maximize the window and move the cursor to the top right of the screen, it will flicker between focusing the close button and whatever is below the window at the cursor as I slowly drag the cursor down. These dead zones mean that if I move my cursor to the top right of my screen to close whatever maximized window I have up, there's a chance that the click will be transferred to the window below it. If the window below it has the same dead zone, it presumably means the click goes to the desktop, but if it doesn't (like the Brave browser doesn't), it means you'll be closing the window below the intended target instead.


STEPS TO REPRODUCE
1. Maximize a Qt application like Dolphin or Gwenview
2. Move cursor to top rightmost part of screen, the close button should be highlighted
3. Slowly move the cursor up and down along the right edge of the screen by the close button

OBSERVED RESULT
The close button flickers, indicating it's going in and out of focus, and the things behind the maximized window are targeted when the close button is not highlighted and the mouse is clicked.

EXPECTED RESULT
The close button should be highlighted consistently, being targeted by the cursor, until the cursor is below it.

SOFTWARE/OS VERSIONS
Linux: 6.0.2-arch1-1
KDE Plasma Version: 5.26.1
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6

ADDITIONAL INFORMATION
I am also using Wayland with an AMD rx570 graphics card, if that helps any.
Comment 1 Aurora Robb Kristiansen 2022-10-19 17:19:46 UTC
This has been happening to me a lot as well, I'm using Plasma Wayland with Breeze Light (from the Breeze Twilight global global theme), same button locations, same graphics card manufacturer.

KDE Plasma 5.26.1
KDE Frameworks 5.99
Qt 5.15.6
Linux 6.0.2

Video: https://www.youtube.com/watch?v=5lbshX0gklQ
Comment 2 Nate Graham 2022-10-19 18:09:46 UTC
Can reproduce with 200% scale too, also on Wayland. Probably fallout from the floating-point positioning work in 5.26 that's a precursor for proper fractional scaling support.

This inconsistently breaks Fitts' Law for all screen edges (not just the close button) and is quite annoying.
Comment 3 Marco Martin 2022-10-24 10:25:02 UTC
possibly related/same bug as https://bugs.kde.org/show_bug.cgi?id=459373 ?
Comment 4 Zamundaaa 2022-10-24 11:18:27 UTC
It happens at 100% scale and with native Wayland applications, so it should be unrelated.
Looking closely at the cursor when I push it to the right border, it moves back and forth a little. PointerInputRedirection lets the cursor move until 1919.99999 on my 1080p screen, and then moves it back to 1919.0, effectively moving it in and out of the screen.
Comment 5 Arjen Hiemstra 2022-10-25 09:31:41 UTC
Git commit 6ef2cdc332f40eb110d7918cadae8985c384ee7c by Arjen Hiemstra.
Committed on 25/10/2022 at 08:44.
Pushed by ahiemstra into branch 'master'.

Window: Floor rather than round when doing hitTest for the decoration

Otherwise we may end up with coordinates that are outside the decoration
and inadvertantly failing the hittest.

M  +1    -1    src/window.cpp

https://invent.kde.org/plasma/kwin/commit/6ef2cdc332f40eb110d7918cadae8985c384ee7c
Comment 6 Arjen Hiemstra 2022-10-25 10:00:03 UTC
Git commit d78187005432ed02159963fd76554678a9db2e67 by Arjen Hiemstra.
Committed on 25/10/2022 at 09:59.
Pushed by ahiemstra into branch 'Plasma/5.26'.

Window: Floor rather than round when doing hitTest for the decoration

Otherwise we may end up with coordinates that are outside the decoration
and inadvertantly failing the hittest.
(cherry picked from commit 6ef2cdc332f40eb110d7918cadae8985c384ee7c)

M  +1    -1    src/window.cpp

https://invent.kde.org/plasma/kwin/commit/d78187005432ed02159963fd76554678a9db2e67
Comment 7 Kody 2022-10-25 13:17:55 UTC
(In reply to Arjen Hiemstra from comment #5)
> Git commit 6ef2cdc332f40eb110d7918cadae8985c384ee7c by Arjen Hiemstra.
> Committed on 25/10/2022 at 08:44.
> Pushed by ahiemstra into branch 'master'.
> 
> Window: Floor rather than round when doing hitTest for the decoration
> 
> Otherwise we may end up with coordinates that are outside the decoration
> and inadvertantly failing the hittest.
> 
> M  +1    -1    src/window.cpp
> 
> https://invent.kde.org/plasma/kwin/commit/
> 6ef2cdc332f40eb110d7918cadae8985c384ee7c

Thank you for taking the time to hunt down the bug and fix it. I'm glad it was a simple fix