Bug 483309 - Resizing window that opens maximized glitches
Summary: Resizing window that opens maximized glitches
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 485839 485986 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-03-12 03:14 UTC by fanzhuyifan
Modified: 2024-04-23 03:05 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.1


Attachments
glitches during resize (3.12 MB, video/webm)
2024-03-12 03:14 UTC, fanzhuyifan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fanzhuyifan 2024-03-12 03:14:40 UTC
Created attachment 167008 [details]
glitches during resize

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. Open dolphin, maximize it, and close it
2. Open dolphin again. It should open maximized.
3. Drag titlebar to unmaximize it
4. Resize from any edge

OBSERVED RESULT
The window size changes abruptly in a really weird way (see attachment)

EXPECTED RESULT
The window resize like usual

SOFTWARE/OS VERSIONS
Can reproduce on wayland, tested on neon unstable; arch 6.0.1, and arch dev build.

ADDITIONAL INFORMATION
Comment 1 Zamundaaa 2024-03-12 14:23:34 UTC
Can reproduce
Comment 2 fanzhuyifan 2024-03-12 14:38:17 UTC
Problem seems be a size of 0,0 being set in these lines [0]:

                const QRectF &geom_restore = geometryRestore();
                if (rules()->checkMaximize(MaximizeRestore) == MaximizeRestore) {
                    setMoveResizeGeometry(geom_restore);
                }

[0] https://invent.kde.org/plasma/kwin/-/blob/master/src/window.cpp?ref_type=heads#L1458
Comment 3 Zamundaaa 2024-03-12 14:46:46 UTC
The size of 0x0 is what gets sent to the app, which responds by resizing to its preferred size. It *should* be replaced with that preferred size once the app has actually resized
Comment 4 serfreeman1337 2024-03-21 14:27:33 UTC
On master, this problem can be solved by adding setMoveResizeGeometry(frameGeometry) after this line: 
https://invent.kde.org/plasma/kwin/-/blob/8bf1f9203b4016362e1f9f15f1e5b8efddad1b8e/src/xdgshellwindow.cpp#L228 

Or by replacing moveResizeGeometry with frameGeometry on this line:
https://invent.kde.org/plasma/kwin/-/blob/8bf1f9203b4016362e1f9f15f1e5b8efddad1b8e/src/window.cpp?page=2#L1210
Comment 5 Bug Janitor Service 2024-03-27 04:32:39 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5528
Comment 6 Vlad Zahorodnii 2024-04-02 16:53:34 UTC
Git commit 298a8ca8c57b2d4b2764a1159a9a88e6698408a8 by Vlad Zahorodnii, on behalf of Ser Freeman.
Committed on 02/04/2024 at 16:42.
Pushed by vladz into branch 'master'.

XdgSurfaceWindow: Always update move resize geometry

Since interactive move resize logic has changed, there is
no need to guard maybeUpdateMoveResizeGeometry anymore.

M  +2    -5    src/xdgshellwindow.cpp

https://invent.kde.org/plasma/kwin/-/commit/298a8ca8c57b2d4b2764a1159a9a88e6698408a8
Comment 7 fanzhuyifan 2024-04-20 23:51:39 UTC
*** Bug 485839 has been marked as a duplicate of this bug. ***
Comment 8 Patrick Silva 2024-04-23 03:05:57 UTC
*** Bug 485986 has been marked as a duplicate of this bug. ***