Bug 415591

Summary: In a multi-display setup, KDE apps only remember window size across program launches when closed on the left-most display
Product: [Frameworks and Libraries] frameworks-kxmlgui Reporter: Dave <devdduits>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: REPORTED ---    
Severity: normal CC: miranda, nate, steve, twopwood
Priority: NOR Keywords: wayland
Version: 5.64.0   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=412322
https://bugs.kde.org/show_bug.cgi?id=415821
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Dave 2019-12-26 21:19:58 UTC
SUMMARY
I’ve been using Plasma for a couple of days now and I noticed some strange window sizing issues. It seems like QT application windows don’t respect window size changes when dealing with a my multi-monitor setup. If I open a QT application on my center or right monitor and resize the window, close the application and open it again the window size will never persist. Only the left monitor retains window size changes (however Kate is an exception). Strangely enough this problem never occurs when dealing with GTK applications.

I’ve found three cases related to this issue:

Case 1, Ark and Okular:
These two applications always copy over the window size that was last changed on the left monitor. In other words if I change the window size on the center or right monitor the window size never changes. It always reverts back to the last window size that was set on the left monitor.

Example Ark: https://youtu.be/uK9Rh5DG2Nw
Example Okular: https://youtu.be/uYCmiDxNnN8

Case 2, Kate:
Kate varies a little from the previous case. When the application is opened and the window size is changed on the left monitor there are again no problems. If the application is opened and closed on either the center or right monitor and the opened again the window size is reset to the small default size.
Example: https://youtu.be/3o_g-wbbNow

Case 3, Gnote and Celluloid:
These two applications always retain the change window size, regardless of what monitor the window size was changes on. This is what I would consider intended behavior. 
Example Gnote: https://youtu.be/pCq2UyrLK4I
Example Celluloid: https://youtu.be/cjw4-zsiHb0

STEPS TO REPRODUCE
Varies from case but usually goes something like this:
1. Open application on center monitor (having a multi-monitor setup).
2. Resize the application window.
3. Close the application.
4. Open the same application again.
5. Observe that the window size has not persisted.

OBSERVED RESULT
Kate, Ark and Okular do not persist window size changes if those changes were made on either my center or right monitors. 

EXPECTED RESULT
The expected result is the same as how the GTK based applications currently behave, as shown in the video example. Basically if I open an application on my center monitor and resize it, then close the application and then open it again the window size should be persisted.

I’ve provided some general information below. If anyone requires any logs, config files or other information, please let me know.

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux 
KDE Plasma Version: 5.17.4
KDE Frameworks Version: 5.64.0
Qt Version: 5.13.2
Kernel Version: 5.4.2-1-MANJARO
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-4790K CPU @ 4.00GHz
Memory: 7,7 GiB of RAM

ADDITIONAL INFORMATION
Monitor setup:
Left monitor: 1680x1050
Center monitor: 2560x1440
Right monitor: 1080x1920

Applications:
Kate: 19.08.3
Ark: 19.08.3
Okular: 1.8.3
Gnote: 3.34.1
Celluloid: 0.18

$ xrandr -q
Screen 0: minimum 320 x 200, current 5320 x 1920, maximum 16384 x 16384
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected primary 2560x1440+1680+351 (normal left inverted right x axis y axis) 597mm x 336mm
   2560x1440     59.95*+
   1920x1080     60.00    50.00    59.94  
   1920x1080i    60.00    50.00    59.94  
   1280x1440     59.91  
   1680x1050     59.88  
   1280x1024     75.02    60.02  
   1440x900      59.90  
   1280x960      60.00  
   1280x720      60.00    50.00    59.94  
   1024x768      75.03    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       75.00    72.81    66.67    60.00    59.94  
   720x400       70.08  
DVI-0 connected 1080x1920+4240+0 left (normal left inverted right x axis y axis) 531mm x 299mm
   1920x1080     60.00*+
   1600x1200     60.00  
   1680x1050     59.88  
   1280x1024     60.02  
   1440x900      59.90  
   1280x960      60.00  
   1152x720      59.97  
   1024x768      60.00  
   800x600       60.32    56.25  
   640x480       66.67    59.94  
DVI-1 connected 1680x1050+0+110 (normal left inverted right x axis y axis) 474mm x 296mm
   1680x1050     59.95*+
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1440x900      74.98    59.90  
   1280x960      60.00  
   1280x720      60.00  
   1024x768      75.03    70.07    60.00  
   832x624       74.55    75.01  
   800x600       72.19    75.00    60.32    56.25  
   640x480       75.00    72.81    66.67    59.94  
   720x400       70.08
Comment 1 Dave 2019-12-26 21:42:43 UTC
> "Only the left monitor retains window size changes (however Kate is an exception)."
Ignore the comment about Kate being an exception in the summary. What I meant to say was that Kate's window size always resets when it is opened, closed and then opened again on either the center or right monitor. Kate is a different case seeing as Ark and Okular always copy over the window size last set on the left monitor.
Comment 2 twopwood 2022-01-22 21:54:55 UTC
I have this exact same issue.  A couple things I can add:

- If both monitors are the same resolution and orientation there is no issue, regardless of relative placement and which monitor is primary.
- I can add Window Rule in Window Management that will force a new window to appear on the right-most monitor using the "Position" and "Ignore requested geometry" Properties but this does not solve the remember size and position issue.
-- Although Dolphin seems to ignore any Window Rule I have tried
- I have tried deleting the ~/.config/*rc files (e.g. ~/.config/konsorerc, ~/.config/dolphinrc) to reset them and this does not solve the issue.
- I have tried installing apps via flatpak and they have the same issue.

SOFTWARE/OS VERSIONS
Operating System: Debian GNU/Linux 11 unstable 
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2
Kernel Version: 5.15.0-3-amd64 (64-bit)
OS Type: 64-bit
Graphics Platform: X11
Processors: 48 × Intel® Xeon® CPU E5-2697 v2 @ 2.70GHz
Memory: 503.9 GiB of RAM
Graphics Processor: AMD Radeon RX 580 Series

Dolphin: 21.08.2
Konsole: 21.08.2
Kate: 21.08.2
Okular: 21.08.3
Comment 3 Vlad Zahorodnii 2022-01-25 09:59:49 UTC
Looks like an issue in KMainWindow.