Bug 477103

Summary: Window becomes huge and upside-down when its window title is long
Product: [Plasma] kwin Reporter: wsyxbcl
Component: effects-overviewAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: fanzhuyifan, kde, nate, nico
Priority: NOR Keywords: qt6
Version First Reported In: 5.27.80   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: a video where the described behavior is triggered 3 times
windows still inverted

Description wsyxbcl 2023-11-16 15:40:24 UTC
Created attachment 163220 [details]
a video where the described behavior is triggered 3 times

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. a window with long title, in my case it contains over 30 Chinese character
2. open multiple windows, few terminals for example
3. trigger the quick tiling

OBSERVED RESULT
The 'long title' expand and the corresponding window is flipped.

EXPECTED RESULT
normal tiling

SOFTWARE/OS VERSIONS

KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.245.0
Qt Version: 6.6.0

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2023-11-17 20:29:17 UTC
Interesting, do you on;y see this happening to windows with long titles? Is that reproducible for you? I can't reproduce it with long window titles myself.
Comment 2 wsyxbcl 2023-11-18 04:17:46 UTC
It can be easily reproduce in my case, I suspect that you didn't open enough windows to reproduce.

I suggest,
1. open a long-title window, e.g. kate XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
2. start opening windows to fill the overview screen
    2.1 start %d windows
    2.2 trigger the quick tiling and observe
    2.3 if normal, repeat 2.1 and 2.2
Comment 3 wsyxbcl 2023-11-18 04:30:20 UTC
> do you on;y see this happening to windows with long titles?

I believe the issue may occur on any window,  as it might be related to the allocation of spaces on the monitor for multiple windows.  In such case, windows with long titles will be the initial ones to 'overflow', facilitating easier observation and reproduction.  I should use a more accurate description in the bug report, sorry about that.
Comment 4 Nate Graham 2023-12-05 17:16:23 UTC
*** Bug 478093 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2023-12-11 22:43:40 UTC
*** Bug 478312 has been marked as a duplicate of this bug. ***
Comment 7 Vlad Zahorodnii 2023-12-12 13:55:44 UTC
Git commit 667b95e24045c30efa319e8f770b8e53d6885fb7 by Vlad Zahorodnii, on behalf of Niccolò Venerandi.
Committed on 12/12/2023 at 14:55.
Pushed by vladz into branch 'master'.

Make window captions in Overview 2 lines at most

Captions are set to elide with ElideRight, which does allow for multi-line captions.
However, this means that the height of the captions depends on their width (since a shorter
width results in more lines), and the width of the captions depends on the size of the
window thumbnail, which depends on the height of the caption to be positioned. If the
caption is really long, this can cause visual glitches. Having a maximum line value avoids that.

M  +10   -2    src/plugins/private/expolayout.cpp
M  +1    -0    src/plugins/private/qml/WindowHeapDelegate.qml

https://invent.kde.org/plasma/kwin/-/commit/667b95e24045c30efa319e8f770b8e53d6885fb7
Comment 8 fanzhuyifan 2023-12-13 23:16:19 UTC
Created attachment 164150 [details]
windows still inverted

Reopening since this bug can still be triggered when there are too many windows open, even after https://invent.kde.org/plasma/kwin/-/commit/667b95e24045c30efa319e8f770b8e53d6885fb7
Comment 9 fanzhuyifan 2023-12-14 05:08:56 UTC
(In reply to fanzhuyifan from comment #8)
> Created attachment 164150 [details]
> windows still inverted
> 
> Reopening since this bug can still be triggered when there are too many
> windows open, even after
> https://invent.kde.org/plasma/kwin/-/commit/
> 667b95e24045c30efa319e8f770b8e53d6885fb7

Oh sorry my bad. The windows are actually right side up.