Bug 499630 - Multiple KDE programs are not remembering their maximized state
Summary: Multiple KDE programs are not remembering their maximized state
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 6.2.90
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-07 05:42 UTC by John
Modified: 2025-02-24 09:11 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John 2025-02-07 05:42:47 UTC
SUMMARY
Multiple KDE programs are not remembering their maximized state

STEPS TO REPRODUCE
1. Boot KDE Neon
2. Open each of the programs mentioned in OBSERVED RESULT below
3. Maximize them
4. Close them
5. Open them again

OBSERVED RESULT
-Anthy dictionary editor
-Help Center
-Install system
-KDE Connect SMS
-Spectacle
-Welcome Center

Each an be maximized and closed without any problem.
I did it by clicking the maximize button, but I assume  the problem can be seen by maximizing them by dragging to the top edge too.

But the next them they are opened they will still open in their little initial window. (not maximized)

EXPECTED RESULT
I expect that they remember their last window state, in this case being maximized.
Like other programs (KDE or non-KDE) can do it without problem: Dolphin, Kate, Konsole, VLC, Firefox, etc.

Almost always I work with only one window at a time so I prefer to each each of them maximized so I'm able to see all content at a glance, not have to scroll if the content fits and be able to quickly close the window by clicking in the top-right corner.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
KDE Plasma Version: 6.2.90
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.1
Kernel Version: 6.8.0-51-generic (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Hardware: Laptop Dell Inspiron 5770
Graphics Processor 1: Mesa Intel® UHD Graphics 620 (main)
Graphics Processor 2: AMD Radeon R5 M465 Series

From my quick tests: Discover, Dolphin and System settings don't have this problem, so I'm not sure this bug is valid anymore:
https://bugs.kde.org/show_bug.cgi?id=383844

I would've tested more programs, but they were not installed by default in KDE Neon.
Only other that I installed myself for testing is KDE Partition Manger and it doesn't have this problem.
Comment 1 Vlad Zahorodnii 2025-02-07 09:31:10 UTC
kwin doesn't remember the maximized state. an app needs to restore the maximized state manually. please file a bug report against each individual app
Comment 2 John 2025-02-07 17:32:36 UTC
(In reply to Vlad Zahorodnii from comment #1)
> kwin doesn't remember the maximized state. an app needs to restore the
> maximized state manually. please file a bug report against each individual
> app

I understand!
But I have a question...
Can't Kwin override this behavior if it wants to?
Let's say for programs that are not develop / maintained anymore.
Like Anthy dictionary editor, which seems to be actually called Kasumi.
And it seems that it's not a KDE program and I'm not sure which is it's repository.
The newest and probably more developed that I could find for it it's this:
https://github.com/fujiwarat/kasumi-unicode
But even here, its last commit is 4 years ago and even if I'll open a bug report for the maximized state not being remember, I'm not sure if it will ever be fixed.

So couldn't Kwin bypass the program's support, neutrality, inaction about this thing and open it maximized as that's what the user prefers?
As a long-time Windows 7 user, I never remember having such a problem there with the hundreds of programs that I installed and opened over the years.
Of course they were some programs that din't want to maximize at all and always remained in windowed mode, but the ones that did always remembered it.
I don't think Windows 7 left it to the individual programs to do this.

Anywhere, here are the bug reports for individual  KDE programs:
Help Center
https://bugs.kde.org/show_bug.cgi?id=499648
Install System (here I was not sure what is the right classification for it, so I've put it to KDE Neon) 
https://bugs.kde.org/show_bug.cgi?id=499650
KDE Connect SMS
https://bugs.kde.org/show_bug.cgi?id=499651
Spectacle
https://bugs.kde.org/show_bug.cgi?id=499652
Welcome center
https://bugs.kde.org/show_bug.cgi?id=499653
Comment 3 cwo 2025-02-14 01:44:03 UTC
(In reply to John from comment #2)
> Can't Kwin override this behavior if it wants to?

If you just want to make sure that a particular application always starts maximized, you can just use a window rule. Right-click the title bar, More Actions > Configure Special Application Settings. Click Add Property, then click the Add button (Plus symbol) for both "Maximized horizontally" and "Maximized vertically". Apply, and it should always set that application to be maximized when it starts. (If you're having trouble with this, feel free to ask on discuss.kde.org, or ping me there under the same user name if you don't get replies).

Remembering on the kwin side is probably hard to get right, as kwin does not know which window is which (an application might have multiple windows that look the same to kwin, same application and window title, but that are different), and playing guessing games might lead to problems later. For KDE applications please file a bug (thanks for the ones you already filed!), and for older applications that are no longer being developed forcing a state with window rules can be a workaround.
Comment 4 John 2025-02-14 04:57:15 UTC
(In reply to cwo from comment #3)
> (In reply to John from comment #2)
> 
> If you just want to make sure that a particular application always starts
> maximized, you can just use a window rule. Right-click the title bar, More
> Actions > Configure Special Application Settings. Click Add Property, then
> click the Add button (Plus symbol) for both "Maximized horizontally" and
> "Maximized vertically". Apply, and it should always set that application to
> be maximized when it starts. (If you're having trouble with this, feel free
> to ask on discuss.kde.org, or ping me there under the same user name if you
> don't get replies).

That's great to have and I'm glad such things exists!
But the problem is that even if I succeed doing that (as I haven't ever created a window rule), there's still the problem that Plasma still don't have a way to export and import all the changed settings and configuration and I have to do it again after I do a clean install / reinstall of the OS, for my 2 computers (desktop and laptop), for my parents computers and for 3 of my friends that I made Linux + Windows dual-boot setups.
Because of this I rather prefer to have things fixed at the core, hence all the bug reports I'm creating for things that I consider to be problems for me and maybe they are problems for others too.

BTW, I have tried what you said with the Help Center's window, but it didn't work initially.
After adding both values a new section called Size and Position" appeared with the two values, but the "Apply initially" option had the default radio button set to "No". I switched both to "Yes" and now it works!
This is create as a workaround and doing custom stuff for whatever reason, but for the case of just remembering the window state between windowed and maximized, I prefer that the core issue is fixed if possible. I don't know if I can keep up with manually creating these window rules for every computer that I manage and then do them again on clean installs / reinstalls / upgrades.
I rather prefer to spend some time, probably more to test things and write good bug reports as this is something that I have to do once and then it will be fixed for the years to come and it doesn't matter how many computers I own or manage.

> Remembering on the kwin side is probably hard to get right, as kwin does not
> know which window is which (an application might have multiple windows that
> look the same to kwin, same application and window title, but that are
> different), and playing guessing games might lead to problems later. For KDE
> applications please file a bug (thanks for the ones you already filed!), and
> for older applications that are no longer being developed forcing a state
> with window rules can be a workaround.

I was just thinking that Kwin can see that I have pressed once the maximize button or dragged the window to the top edge since it is the once that maximized it (a reaction to my action)
Doing something for my action (in this case maximizing the window) made me think that it cannot say anymore that it doesn't know what I did, what it did and to which window it did (as it maximized the one that I wanted to maximize, not another).

But I understand if this is problematic and takes too much time to solve.
I too wish that KDE developers and other contributors work on HDR support, Vulkan support and other more important things than this, since for these there's also the window rules backup fixing.

Nate also pointed out to me that  Kwin already have an possibility to open all windows as maximized so that's also something that I have to try.
I'm already wondering if that's for new windows only (not having any previous state so nothing to remember) or will force also the ones that have a previous state to remember, but that's an option that I have to try in the future on a clean install to see how it really works.
Comment 5 John 2025-02-14 04:58:38 UTC
Since I can't edit my comment here's Nate's comment:
https://bugs.kde.org/show_bug.cgi?id=499653#c6
Comment 6 cwo 2025-02-14 07:09:03 UTC
> But the problem is that even if I succeed doing that (as I haven't ever created a window rule), there's still the problem that Plasma still don't have a way to export and import all the changed settings and configuration and I have to do it again after I do a clean install / reinstall of the OS, for my 2 computers (desktop and laptop), for my parents computers and for 3 of my friends that I made Linux + Windows dual-boot setups.

This is a separate issue. And you can just save your configuration and copy it to a new install, the same way you would save your other files. I always do this if I decide to reinstall for some reason (which I usually don't need to honestly)

And there are other ways to do such things if you need to do this frquently for some reason that would also apply to other settings that you want to have changed. But a bug report is not a good place to discuss this; such questions are better suited for discuss.kde.org or similar forums.

> I was just thinking that Kwin can see that I have pressed once the maximize button or dragged the window to the top edge since it is the once that maximized it (a reaction to my action)  Doing something for my action (in this case maximizing the window) made me think that it cannot say anymore that it doesn't know what I did, what it did and to which window it did (as it maximized the one that I wanted to maximize, not another).

But an application can open many windows. kwin can't necessarily identify when the user opens a window of the application again later which window it is. It's reasonable that  a user might want to have some windows of an application maximized, and others not. For example, a user may have some Konsole windows that they want maximized, but others they would want to have half-maximized so that they can put two side-by-side. If Konsole handles remembering the position, this can work (for example, the user could use different sessions to tell Konsole which kind of window it should be). If kwin forces the size and position over what the application requests,  it will not work, or at best kwin would need to guess based on some other criterion such as window title and this may not apply in all cases. That's why this is best left to the application.

It would be better to fix the applications to work correctly (saving their own state), and maybe have a workaround for the few that cannot be changed (e.g. because they are no longer being developed) using window rules or some other mechanism, rather than breaking other use cases. If you just want all windows to start maximized, there are also options for that (including the setting Nate told you about or window rules that apply to every application window).
Comment 7 John 2025-02-17 07:36:36 UTC
For Haruna:
https://bugs.kde.org/show_bug.cgi?id=500225