Bug 475871

Summary: [Wayland] Window resized incorrectly when initialised as maximised
Product: [I don't know] kde Reporter: Sollace <sollacea>
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: REOPENED ---    
Severity: normal CC: nate, william+kde
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Demostrating the described bug
Case 1: Both horizontal and vertical
Case 2: Horizontal
Case 3: Vertical

Description Sollace 2023-10-20 10:26:35 UTC
Created attachment 162447 [details]
Demostrating the described bug

SUMMARY

Currently on Wayland if you open a new window in maximised (i.e. if the program had its window maximised when you closed it last, and you reopen it) and then restore the window by repositioning it, attempting to resize it after doing so will cause the window geometry to jump to the top-left of the display.

My assessment (given after reviewing footage, I notice the bug coincides with the drag point of the window also jumping to the top-left) is that the cursor position for windows spawned in this manner is not being initialised when it gains focus.

STEPS TO REPRODUCE
1. Open a new dolphin instance (default META+E)
2. Click "maximise" to maximise it (if not already)
3. Click "close"
4. Repeat step 1
5. Unmaximise the window by dragging it by the title bar to the middle of the screen
6. Attempt to resize the window by clicking on its top-left corner and dragging down and to the right

OBSERVED RESULT

The window jumps to the top-left of the screen and is given its minimum dimensions.

EXPECTED RESULT

Only the top and left edges of the window should move, and should move down and to the right proportional to the cursor's movement.

SOFTWARE/OS VERSIONS
Windows: No
macOS: No
Linux/KDE Plasma: Yes
(available in About System)
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.11

ADDITIONAL INFORMATION

Operating System: Manjaro Linux 

Kernel Version: 6.1.55-1-MANJARO (64-bit)
Graphics Platform: Wayland
Comment 1 Nate Graham 2023-10-20 16:47:42 UTC

*** This bug has been marked as a duplicate of bug 449105 ***
Comment 2 William Chambers 2024-04-17 03:29:48 UTC
I am running KDE with kwin 6.1 on Arch and am experiencing this exact problem. I originally thought it was an issue with Godot, but Konsole and Firefox have exhibited the same behavior.

Example Video: https://youtu.be/Xr5cmBRonls

Honestly have no idea how I could help debug this as it is super strange, but am happy to help however I can.
Comment 3 Nate Graham 2024-04-26 17:18:10 UTC

*** This bug has been marked as a duplicate of bug 449105 ***
Comment 4 Sollace 2024-05-17 12:24:38 UTC
Re-opening this one as suggested by nate@kde.org (Nate Graham) because Bug #449105 does not fully describe the same issue and the problem is still occuring in plasma 6.

Steps to reproduce:
 - Open a dolphin window
 - Click [maximise]
 - Click [close]
 - Open a new dolphin window
 - Drag it by the title bar

Observed behaviour:
The window gets offset to where its top-left corner is placed at the cursor. After releasing the mouse and attempting to resize by:

1. Dragging the top-left corner of the window causes the bottom and right edge of the window to jump past the cursor position pushing the entire window off of the screen.
2. Dragging the right edge of the window causes the bottom edge of the window to jump to past the cursor position causing the window to squash vertically
3. Dragging the bottom edge of the window causes the right edge of the window to jump to past the cursor position causing the window to squash horizontally


My system versions:

Operating System: Manjaro Linux 
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Kernel Version: 6.6.23-1-rt28-MANJARO (64-bit)
Graphics Platform: Wayland
Processors: 16 × 11th Gen Intel® Core™ i9-11950H @ 2.60GHz
Memory: 31.1 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics
Manufacturer: HP
Product Name: HP ZBook Fury 17.3 inch G8 Mobile Workstation PC
Comment 5 Sollace 2024-05-17 12:25:10 UTC
Created attachment 169564 [details]
Case 1: Both horizontal and vertical
Comment 6 Sollace 2024-05-17 12:25:34 UTC
Created attachment 169565 [details]
Case 2: Horizontal
Comment 7 Sollace 2024-05-17 12:26:02 UTC
Created attachment 169566 [details]
Case 3: Vertical