Bug 489500 - KWin likes to place windows larger than the screen such that the titlebar is cut off at the top
Summary: KWin likes to place windows larger than the screen such that the titlebar is ...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 6.1.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-30 15:57 UTC by Ellie
Modified: 2024-07-27 09:12 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ellie 2024-06-30 15:57:47 UTC
SUMMARY

From my experience on a tablet-like device that has a relatively small screen, plasma likes to play windows larger than the screen such that the titlebar is cut off at the top. This seems sadly like an unfortunate way to handle this, since this means neither can the window be moved around nor can the menu bar be reached which usually tends to be the most central component even if other significant parts of the window aren't reachable. I would suggest that windows should always be placed such that the title bar inside the bounds of the screen, even if the window is otherwise too large. Sorry if this is actually a Qt or KDE Frameworks bug, I'm not quite sure which component exactly is responsible for the placement here. However, it seems to affect pretty much all KDE and Qt applications that I tried, at least when testing any that spawn a window with a larger minimum size than the screen size.

STEPS TO REPRODUCE

1. In display settings, set the scaling factor such that many Qt applications wont vertically fit on the screen anymore.
2. Launch any affected application

OBSERVED RESULT

Quite often, title bar and menu bar are cut off at the top of the screen.


EXPECTED RESULT

Title bar and menu bar always spawn inside the visible screen area, even if other parts are cut off.

SOFTWARE/OS VERSIONS

Windows: 
macOS: 
Linux/KDE Plasma: postmarketOS Edge
(available in About System)
KDE Plasma Version: 6.1.1
KDE Frameworks Version: 6.3.0
Qt Version: 6.6.3

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2024-07-02 20:53:43 UTC
IIRC this is intentional or something? Vlad or Xaver, do you remember what I might be thinking of?
Comment 2 Bug Janitor Service 2024-07-22 21:45:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6157
Comment 3 Zamundaaa 2024-07-23 14:27:32 UTC
Git commit d548ade3a64f0c9defc98ff2f9c26fcea0580380 by Xaver Hugl.
Committed on 23/07/2024 at 14:02.
Pushed by zamundaaa into branch 'master'.

placement: keep the titlebar in the screen with centered placement

...even if the window is larger than the screen.

M  +2    -2    src/placement.cpp

https://invent.kde.org/plasma/kwin/-/commit/d548ade3a64f0c9defc98ff2f9c26fcea0580380
Comment 4 Zamundaaa 2024-07-23 14:27:40 UTC
Git commit 0e25405151ebf5e02dfe576886027b63da0877f1 by Xaver Hugl.
Committed on 23/07/2024 at 14:02.
Pushed by zamundaaa into branch 'master'.

placement: don't overwrite scheduled position change in cascadeIfCovering

As it used the frame geometry, the check for covering windows was sometimes wrong,
and additionally overwrite changes to the window position Placement had made before,
which could end up with the window origin wrongly not being put inside of the screen
in some cases.

M  +1    -1    src/placement.cpp

https://invent.kde.org/plasma/kwin/-/commit/0e25405151ebf5e02dfe576886027b63da0877f1
Comment 5 Zamundaaa 2024-07-23 14:27:49 UTC
Git commit b0a8294b0521944eb6bf40c38ba3cef534e55f6f by Xaver Hugl.
Committed on 23/07/2024 at 14:16.
Pushed by zamundaaa into branch 'master'.

autotests: test placement to always put the titlebar on the screen

M  +34   -0    autotests/integration/placement_test.cpp

https://invent.kde.org/plasma/kwin/-/commit/b0a8294b0521944eb6bf40c38ba3cef534e55f6f
Comment 6 Zamundaaa 2024-07-23 14:46:16 UTC
Git commit 8a5ac138ce2a93407a5ca64583d6fd89072b06f9 by Xaver Hugl.
Committed on 23/07/2024 at 14:33.
Pushed by zamundaaa into branch 'Plasma/6.1'.

placement: don't overwrite scheduled position change in cascadeIfCovering

As it used the frame geometry, the check for covering windows was sometimes wrong,
and additionally overwrite changes to the window position Placement had made before,
which could end up with the window origin wrongly not being put inside of the screen
in some cases.

M  +1    -1    src/placement.cpp

https://invent.kde.org/plasma/kwin/-/commit/8a5ac138ce2a93407a5ca64583d6fd89072b06f9
Comment 7 Zamundaaa 2024-07-23 14:46:21 UTC
Git commit a962b30e9c43614a4140dd53019fc6288ae701f2 by Xaver Hugl.
Committed on 23/07/2024 at 14:33.
Pushed by zamundaaa into branch 'Plasma/6.1'.

placement: keep the titlebar in the screen with centered placement

...even if the window is larger than the screen.

M  +2    -2    src/placement.cpp

https://invent.kde.org/plasma/kwin/-/commit/a962b30e9c43614a4140dd53019fc6288ae701f2
Comment 8 Zamundaaa 2024-07-23 14:46:25 UTC
Git commit 68c11e79c010236bb8c8aebe29e00f2008194b04 by Xaver Hugl.
Committed on 23/07/2024 at 14:33.
Pushed by zamundaaa into branch 'Plasma/6.1'.

autotests: test placement to always put the titlebar on the screen

M  +34   -0    autotests/integration/placement_test.cpp

https://invent.kde.org/plasma/kwin/-/commit/68c11e79c010236bb8c8aebe29e00f2008194b04
Comment 9 Ellie 2024-07-27 08:30:06 UTC
Thanks so much for the fix, this is very cool! :-)
Comment 10 Roke Julian Lockhart Beedell 2024-07-27 09:12:31 UTC
Does this affect Plasma Mobile, too? It's much more of a problem there.