Bug 401042 - kate doesn't remember size when resized on second monitor
Summary: kate doesn't remember size when resized on second monitor
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kconfig
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Matthew Dawson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-14 19:26 UTC by S. Christian Collins
Modified: 2022-10-12 17:05 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.99
Sentry Crash Report:


Attachments
video showing the bug (1.22 MB, video/mp4)
2018-11-14 19:26 UTC, S. Christian Collins
Details
video showing repro method in VirtualBox (3.76 MB, video/webm)
2019-06-09 18:11 UTC, S. Christian Collins
Details

Note You need to log in before you can comment on or make changes to this bug.
Description S. Christian Collins 2018-11-14 19:26:48 UTC
Created attachment 116311 [details]
video showing the bug

I've discovered a weird bug with Kate where it will not remember its new size when resized on a secondary monitor. It seems that having a different vertical resolution on the secondary monitor might be necessary to make this bug occur.

The attached video demonstrates this problem, and was recorded with KDE neon Developer Edition Git-Unstable running in VirtualBox.

STEPS TO REPRODUCE
1. On a system with two monitors, open Kate and drag it to the secondary monitor.
2. Resize Kate.
3. Close and re-open Kate.

OBSERVED RESULT
Kate opens at the size previous to the resize in step 2.

EXPECTED RESULT
Kate should open at the size it was resized to in step 2.

SOFTWARE/OS VERSIONS
OS: KDE neon Developer Edition Git-Unstable
(available in About System)
KDE Plasma Version: 5.14.80
KDE Frameworks Version: 5.53.0
Qt Version: 5.11.2

ADDITIONAL INFORMATION
Resizing Kate on the primary monitor properly restores the size on app relaunch. Using KWin's window-specific settings to apply a specified size on app launch does not work at all, so it would appear that Kate is handling its window size independently of KWin.
Comment 1 Ahmad Samir 2019-03-23 19:46:26 UTC
Kate uses KWindowConfig::saveWindowSize() and KWindowConfig::restoreWindowSize(); looking at the code this is the expected behaviour, KWindowConfig saves both the width of the screen and the width of the window, the same goes for the height. So IIUC, saving/restoring a window size is tied to the screen dimensions.

Closing as not a bug, feel free to reopen it if you don't agree.
Comment 2 S. Christian Collins 2019-03-23 21:44:36 UTC
Regardless of the method used to store the window dimensions, Kate is not remembering the last size in a multi-monitor setup with different resolutions per monitor, so therefore the bug is still valid.
Comment 3 S. Christian Collins 2019-06-09 18:11:56 UTC
Created attachment 120735 [details]
video showing repro method in VirtualBox

This bug is still present in current Git (Kate package version in KDE neon Developer Edition: 4:19.04.2+p18.04+git20190606.1109-0). I have attached a new video showing how to repro this bug consistently in Virtualbox. Here's how:
1. Configure the VM for two monitors.
2. Set the primary and monitor to 800 x 600 and the secondary monitor to 1024 x 768.
3. Open Kate, drag it to the second monitor and resize it, then close it.
4. Open Kate again.

Result: Kate does not remember the new size.

Is there a way to stop Kate from remembering its window size altogether? I have set KDE's window rules to enforce a specific screen location and size on startup, but Kate overrides this with its own values, and combined with this bug makes for a frustrating experience.
Comment 4 Maxwell Reid 2019-07-27 12:42:24 UTC
I have tested this bug on my dual monitor system. I am seeing the exact same behaviour as shown in the video. Two colleagues of mine who also use KDE can confirm this bug also. This bug occurs with other KDE applications (such as Dolphin and Okular) too, not just Kate.

In my case, my primary montior is to the right of my secondary monitor. This means that I have to move a window to my secondary monitor and resize it there before it will remember that size the next time I start it. This interrupts my workflow and makes the desktop unpleasant to work with.

I switched the positions of my monitors in KDE's settings (the primary monitor is now to the left of the secondary monitor) and the behaviour is now reversed: window sizes are only remembered when changed on the primary (left) monitor.
Comment 5 Bug Janitor Service 2022-01-13 13:27:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kconfig/-/merge_requests/101
Comment 6 Zhong Lufan 2022-10-12 17:05:13 UTC
According to my tests (two screens with different resolutions), this bug has been fixed.