Bug 426813 - Some KXMLGui-using apps are opening maximized instead of windowed
Summary: Some KXMLGui-using apps are opening maximized instead of windowed
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kconfig
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.74.0
Platform: Other Linux
: VHI normal
Target Milestone: ---
Assignee: Matthew Dawson
URL:
Keywords:
: 427867 430145 431267 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-09-21 14:06 UTC by agentxlax
Modified: 2021-07-22 16:20 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.78


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description agentxlax 2020-09-21 14:06:48 UTC
Are other KDE Plasma users experiencing the same issue of Konsole and Dolphin opening maximized screen only.

MY roommate is running Manjaro Plasma and the day before yesterday I noticed that Dolphin will not open windowed. This morning I tried EVERYTHING I could think of to get it to behave and I had to finally give up. Today a member on the EndeavourOS forums is having the same issue but with Konsole. I'm thinking our two issue may be related. Please any and all suggestions at this point to fix the issue or issues would be greatly appreciated, thanks.

https://forum.endeavouros.com/t/konsole-always-opens-maximized/8287/27

https://forum.kde.org/viewtopic.php?f=289&t=167961
Comment 1 Nate Graham 2020-09-21 16:20:22 UTC
It is possible that a window rule has been set which forces these windows to be maximized? You can check in System Settings > Window Management > Window Rules.
Comment 2 agentxlax 2020-09-21 18:33:38 UTC
I've already looked in there my self and the person on the EOS forums already checked for Konsole on this machine.
Comment 3 Nate Graham 2020-09-21 20:24:21 UTC
Thanks for the info. Am I clear that you are reporting this on behalf of your roommate? Are you going to be able to debug on that person's machine?
Comment 4 agentxlax 2020-09-21 21:36:31 UTC
Yes I'll be the one that handles this on his machine. Just let me know what you need.
Comment 5 Nate Graham 2020-09-21 23:28:49 UTC
Ok. Not sure I can help any more though. Perhaps someone else can.
Comment 6 Vlad Zahorodnii 2020-09-22 08:04:44 UTC
A window may become maximized when it's mapped due to several reasons:

(a) the initial window size is bigger than the screen size
(b) the window asked the window manager to maximize it
(c) a window rule sets the maximized state
(d) a script sets the maximized state

Does purging dolphin and konsole config files help to resolve the issue?
Comment 7 agentxlax 2020-09-22 13:24:34 UTC
The member on EOS fixed his by rolling back a week and doing the updates again and seems to be fine now. Now what is exactly involved with purging Dolphin? I don't want to lose his custom service menu items. Thanks
Comment 8 0xCAP 2020-09-27 01:20:21 UTC
Can confirm I'm encountering exactly the same issue on KDE neon User Edition 5.19, using Plasma DE and KWin WM. Even simply pointing out where/how Konsole and/or Dolphin store their startup size preferences would make for a great starting point.
Comment 9 0xCAP 2020-09-27 01:41:24 UTC
Sorry for the double comment, but I wanted to report that I currently solved the issue by removing a bunch of "suspicious" lines from my ~/.config/konsolerc file.
The lines looked like the following:

Window-Maximized 1016x1807=true
Window-Maximized 614x1093=true
Window-Maximized 647x1150=true
Window-Maximized 864x1536=true
Window-Maximized 904x1205=true
Window-Maximized 909x1617=true
Comment 10 Vlad Zahorodnii 2020-09-29 06:01:38 UTC
(In reply to agentxlax from comment #7)
> The member on EOS fixed his by rolling back a week and doing the updates
> again and seems to be fine now. Now what is exactly involved with purging
> Dolphin? I don't want to lose his custom service menu items. Thanks

Sorry for not providing enough information how to do that. The config file for konsole and dolphin is ~/.config/konsolerc and ~/.config/dolphinrc, respectively. By purging, I meant saving a config file and then removing it in /.config. After you've finished testing, restore the config file.
Comment 11 Vlad Zahorodnii 2020-09-29 06:02:14 UTC
Okay, so it looks like konsole maximizes itself at startup.
Comment 12 Nate Graham 2020-09-29 13:36:38 UTC
(In reply to 0xCAP from comment #9)
> Sorry for the double comment, but I wanted to report that I currently solved
> the issue by removing a bunch of "suspicious" lines from my
> ~/.config/konsolerc file.
> The lines looked like the following:
> 
> Window-Maximized 1016x1807=true
> Window-Maximized 614x1093=true
> Window-Maximized 647x1150=true
> Window-Maximized 864x1536=true
> Window-Maximized 904x1205=true
> Window-Maximized 909x1617=true
Are you using Frameworks 5.74? I touched the code that does this recently, so it's possible I regressed something. :(
Comment 13 agentxlax 2020-09-29 17:01:05 UTC
In my case I'm just going to fresh install my roommate's OS and replace it with EbdeavourOS. Nice and minimal and gives me the chance of getting the OS on his M.2 versus the SATA SSD it's now on. I'm currently running EOS and for the most part I've loving it. I'm sure the Dolphin issue he's having is something he did and not his currently installed OS's fault.
Comment 14 Nate Graham 2020-09-29 17:27:51 UTC
Can you tell me the version of Frameworks running on this person's machine? I just need to know if it's 5.74 or not.
Comment 15 0xCAP 2020-09-29 20:16:16 UTC
Yep, I'm on Frameworks 5.74.
Comment 16 Nate Graham 2020-09-29 20:28:51 UTC
Then there's a chance I messed this up. Will investigate.
Comment 17 Nate Graham 2020-10-21 19:35:28 UTC
*** Bug 427867 has been marked as a duplicate of this bug. ***
Comment 18 Nate Graham 2020-12-07 18:17:02 UTC
I'm investigating and can't get this to happen. I have some questions:

1. Is it still happening with the latest Frameworks?
2. Does this happen with only Konsole, or also Dolphin? How about Kate?
3. Are you currently using a scale factor, or have you done so in the past or changed it recently?

4. Do you have multiple screens?
4a if so, do they have differing resolutions?
Comment 19 agentxlax 2020-12-07 20:35:59 UTC
yes he's still having the issue even with the current frameworks and it's dolphin that's doing it not konsole or kate. as foir your 3rd question i believe we had to scale down, but that's been awhile so i can't swear to it. lastly just the one monitor.
Comment 20 Nate Graham 2020-12-08 00:10:14 UTC
Does the dolphinrc file still have multiple

Window-Maximized [something]x[something else]=true

entries in it?

If so, can you attach the file and also mention the screen's resolution?
Comment 21 Nate Graham 2020-12-08 14:58:34 UTC
*** Bug 430145 has been marked as a duplicate of this bug. ***
Comment 22 Nate Graham 2020-12-08 14:58:49 UTC
Another duplicate, re-opening.
Comment 23 Nate Graham 2020-12-08 15:00:58 UTC
Bug is somewhere around here: https://invent.kde.org/frameworks/kconfig/-/blob/master/src/gui/kwindowconfig.cpp#L50

Perhaps the problem is that these entries aren't being deleted when they should be.
Comment 24 Bug Janitor Service 2020-12-08 19:04:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kconfig/-/merge_requests/36
Comment 25 Nate Graham 2020-12-09 18:23:45 UTC
Git commit a62e53e1b1fdb363fefb74907dca339b238e99b9 by Nate Graham.
Committed on 09/12/2020 at 18:23.
Pushed by ngraham into branch 'master'.

Fix windows being inappropriately maximized on launch

When a window is closed while maximized, we write a special string to
the config file so that it gets restored in its maximized state. But we
don't ever delete that thing when the window is un-maximized and closed
again, causing the window to always be maximized when launched.
FIXED-IN: 5.78

M  +3    -0    src/gui/kwindowconfig.cpp

https://invent.kde.org/frameworks/kconfig/commit/a62e53e1b1fdb363fefb74907dca339b238e99b9
Comment 26 Nate Graham 2020-12-09 18:25:08 UTC
Once you get this fix (in Frameworks 5.78), you may need to manually delete the spurious Window-Maximized entries from the app's rc file. But thereafter, they should not come back.
Comment 27 Claudius Ellsel 2020-12-15 20:43:09 UTC
I wonder whether https://bugzilla.opensuse.org/show_bug.cgi?id=1179294 is somehow related. Will try to have a look at the relevant config files the next time I run Tumbleweed.
Comment 28 Christoph Feck 2021-01-07 20:57:21 UTC
*** Bug 431267 has been marked as a duplicate of this bug. ***
Comment 29 Till Schäfer 2021-01-08 09:02:43 UTC
(In reply to Nate Graham from comment #26)
> Once you get this fix (in Frameworks 5.78), you may need to manually delete
> the spurious Window-Maximized entries from the app's rc file. But
> thereafter, they should not come back.

Is there a use case for multiple entries? Otherwise, cannot we just loop through all entries in order to fix already corrupted configs flying around?
Comment 30 Doug Glenn 2021-07-07 19:11:51 UTC
(In reply to 0xCAP from comment #9)
> I currently solved
> the issue by removing a bunch of "suspicious" lines from my
> ~/.config/konsolerc file.
> The lines looked like the following:
> 
> Window-Maximized 1016x1807=true
> ect ...

This fixed my issue. I'd always had a window size defined (130 x 80) that was a good starting point. But like this gentleman, I had a window-maximized line that was totally out of place. Removed it, and expected behaviour was restored.
Comment 31 Nate Graham 2021-07-07 23:24:07 UTC
Yeah there was a brief period of time during which those items were inappropriately written to people's config files. The bug causing this to happen has been fixed now, but it's possible that you would still be affected if it happened to you during that period of time. Removing them is a perfectly acceptable way to fix it for yourself.
Comment 32 Doug Glenn 2021-07-08 02:25:58 UTC
(In reply to Nate Graham from comment #31)
> Yeah there was a brief period of time during which those items were
> inappropriately written to people's config files. The bug causing this to
> happen has been fixed now, but it's possible that you would still be
> affected if it happened to you during that period of time. Removing them is
> a perfectly acceptable way to fix it for yourself.

Considering the time stamp of the participants, true. What flummoxed me was the location. The convention for the .config directory originally was in this format $XDG_CONFIG_HOME/subdir/filename, so I was looking for .config/kde/configuration file location. It never occurred to me they would be in the base of the .config file. The KDE configuration file location has shifted a time or two since it was originally released so I was actually poking around the ./local directory looking. The issue wasn't a major file to me and I knew I'd eventually get around to finding an answer. I do wish the files would eventually follow the convention, but innovation doesn't occur without breaking a rule or two and the growth of Linux, KDE and the other windowing systems is phenomenal. When I ran across it in 1995 you had to know the specific hardware configuration and chipset of the video card to get X to run and all the apps had to be built in order to run. It was a daunting experience but I knew OS/2 was in it's death spiral and I was desperate not to be forced into using any Microsoft products at home. I switched to Linux full time in 1997 and the change from the 1995 version was profound. The growth and maturity has continued to defy my expectations and I don't see that changing.
Comment 33 Nate Graham 2021-07-22 16:20:45 UTC
I'm so glad you see it that way! :)