Bug 449988 - [X11] No Border Window Action Toggle Continually Shrinks the Window Size
Summary: [X11] No Border Window Action Toggle Continually Shrinks the Window Size
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Unclassified
Component: general (show other bugs)
Version: 5.24.0
Platform: Archlinux Packages Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-11 04:26 UTC by hugh
Modified: 2022-02-16 07:24 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.24.1
nate: Wayland-
nate: X11+


Attachments
Firefox window shrinkage (25 bytes, text/plain)
2022-02-12 02:09 UTC, hugh
Details
Firefox window shrinkage (304.86 KB, video/mp4)
2022-02-12 02:16 UTC, hugh
Details
Kate window shrinkag3 (147.84 KB, video/mp4)
2022-02-12 02:17 UTC, hugh
Details
System settings shrinkage (248.75 KB, video/mp4)
2022-02-12 02:25 UTC, hugh
Details
New crash information added by DrKonqi (12.55 KB, patch)
2022-02-13 20:33 UTC, Alireza Ahmadi
Details
No border old behavior, prior to 5.24 (154.67 KB, video/mp4)
2022-02-16 03:47 UTC, hugh
Details
New behavior with 5.24 (58.86 KB, video/mp4)
2022-02-16 03:48 UTC, hugh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hugh 2022-02-11 04:26:48 UTC
STEPS TO REPRODUCE
1. Open a window in Plasma 5.24 (X11)
2. Toggle No Border window action
3. Togger No Border again
4. Togger No Border again
5. Togger No Border again

OBSERVED RESULT
The window will repeatedly shrink with each toggle.

When the titlebar and border is toggled off the window contents are not repainted in the existing window area.  The titlebar is simply removed and new window size now becomes the existing window area.

The window shrinks by the size of the titlebar and border each toggle.

EXPECTED RESULT
Prior to  5.24 toggling the no border setting did not alter the window size.  It remained exactly the same size.

SOFTWARE/OS VERSIONS
Linux Distro : Arch
KDE Plasma Version: 5.24.0
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Graphics Platform: X11

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2022-02-11 20:23:16 UTC
Cannot reproduce on X11 with System Settings and Firefox.

Does it happen for you with all windows, or only some?

Does it happen on Wayland too, or just X11?
Comment 2 hugh 2022-02-12 02:09:56 UTC
Created attachment 146616 [details]
Firefox window shrinkage
Comment 3 hugh 2022-02-12 02:16:55 UTC
Created attachment 146617 [details]
Firefox window shrinkage
Comment 4 hugh 2022-02-12 02:17:44 UTC
Created attachment 146618 [details]
Kate window shrinkag3
Comment 5 hugh 2022-02-12 02:19:04 UTC
All windows using X11, don't use Wayland.
Comment 6 hugh 2022-02-12 02:21:22 UTC
Using Oxygen Application Style, Plasma Style and Window Decorations.
Comment 7 hugh 2022-02-12 02:25:59 UTC
Created attachment 146619 [details]
System settings shrinkage
Comment 8 hugh 2022-02-12 02:39:44 UTC
Changed Global theme to Breeze Dark, no change, still happening.

Are you trying to recreate with a non Arch package base?
Comment 9 Nate Graham 2022-02-12 03:32:21 UTC
I don't use Arch, no. But that shouldn't be relevant here.
Comment 10 hugh 2022-02-13 20:19:48 UTC
I have more than 10 arch systems over multiple machines, both virtual and non virtual.

This is happening on all of them.

If you cannot replicate this then it is relevant.
Comment 11 Alireza Ahmadi 2022-02-13 20:33:12 UTC
Created attachment 146681 [details]
New crash information added by DrKonqi

systemsettings5 (5.18.5) using Qt 5.12.7

- What I was doing when the application crashed:
Changed application style to bb10bright and system settings crashed. and now it crashes every time  selecting any appearaance related settings.

-- Backtrace (Reduced):
#4  QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::operator-> (this=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qscopedpointer.h:118
[...]
#7  QObject::property (this=this@entry=0x0, name=name@entry=0x7f9549c63973 "_pixmapstyle_combobox_pressed") at kernel/qobject.cpp:3970
#8  0x00007f954998d1e4 in QPixmapStyle::drawComboBox (this=0x557ed7c92de0, option=0x557ed84e5a50, painter=0x7ffc9dc05e40, widget=0x0) at styles/qpixmapstyle.cpp:960
#9  0x00007f95199ffbb5 in KQuickStyleItem::paint(QPainter*) () from /usr/lib64/qt5/qml/org/kde/qqc2desktopstyle/private/libqqc2desktopstyleplugin.so
#10 0x00007f95199fffdc in KQuickStyleItem::updatePolish() () from /usr/lib64/qt5/qml/org/kde/qqc2desktopstyle/private/libqqc2desktopstyleplugin.so
Comment 12 Vlad Zahorodnii 2022-02-14 08:09:26 UTC
It looks like we fixed wayland, but broke x11 along the way..
Comment 13 Bug Janitor Service 2022-02-14 08:53:22 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2009
Comment 14 Vlad Zahorodnii 2022-02-14 14:27:55 UTC
Git commit 8e05732670b07b82986f1d3e5ff59ad11bc1a4ec by Vlad Zahorodnii.
Committed on 14/02/2022 at 14:00.
Pushed by vladz into branch 'master'.

x11: Fix shrinking window size after toggling no border multiple times

The first move() in X11Client::createDecoration() will alter the client
size, which will result in the subsequent resize() incorrectly resizing
to a smaller window size.

In order to fix that issue, this change makes X11Client adjust the
frame geometry atomically after creating or destroying window decoration.

M  +2    -4    src/x11client.cpp

https://invent.kde.org/plasma/kwin/commit/8e05732670b07b82986f1d3e5ff59ad11bc1a4ec
Comment 15 Vlad Zahorodnii 2022-02-14 14:30:15 UTC
Git commit d4068754c91f17f01e430f60bfed8975c7170977 by Vlad Zahorodnii.
Committed on 14/02/2022 at 14:30.
Pushed by vladz into branch 'Plasma/5.24'.

x11: Fix shrinking window size after toggling no border multiple times

The first move() in X11Client::createDecoration() will alter the client
size, which will result in the subsequent resize() incorrectly resizing
to a smaller window size.

In order to fix that issue, this change makes X11Client adjust the
frame geometry atomically after creating or destroying window decoration.


(cherry picked from commit 8e05732670b07b82986f1d3e5ff59ad11bc1a4ec)

M  +2    -4    src/x11client.cpp

https://invent.kde.org/plasma/kwin/commit/d4068754c91f17f01e430f60bfed8975c7170977
Comment 16 hugh 2022-02-14 21:52:23 UTC
Thanks for the fix.

Will be in 5.24.1?
Comment 17 Nate Graham 2022-02-14 21:57:24 UTC
That's what the "Version fixed in" field says, no? :)
Comment 18 hugh 2022-02-14 23:03:40 UTC
Yeah, my bad.
Comment 19 hugh 2022-02-16 03:47:35 UTC
Created attachment 146796 [details]
No border old behavior, prior to 5.24
Comment 20 hugh 2022-02-16 03:48:13 UTC
Created attachment 146797 [details]
New behavior with 5.24
Comment 21 hugh 2022-02-16 03:49:37 UTC
Still not working properly.

The window size with no border is still smaller than the original window.  It should be the same size, at least that was the old behavior, which I believe is correct.

See the old behavior vs new behavior video attachments.

Borderless window contents should expand into the old window size with borders.
Comment 22 Vlad Zahorodnii 2022-02-16 07:24:12 UTC
(In reply to hugh from comment #21)
> Still not working properly.
> 
> The window size with no border is still smaller than the original window. 
> It should be the same size, at least that was the old behavior, which I
> believe is correct.
> 
> See the old behavior vs new behavior video attachments.
> 
> Borderless window contents should expand into the old window size with
> borders.

Not sure why window size is kept constant in < 5.24, code doesn't try to do that, it actually tries to do the opposite. Regardless of that, the original issue (constantly shrinking window size has been fixed), please file a new bug report as it can be confusing to track multiple issues in one bug report.