Bug 447102 - Konqueror seems to auto-start every boot
Summary: Konqueror seems to auto-start every boot
Status: REOPENED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: 21.12.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-17 01:38 UTC by Marco Parillo
Modified: 2022-10-31 16:13 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Parillo 2021-12-17 01:38:16 UTC
SUMMARY
It appears that after I upgraded to 21.12.0, Konqueror starts on every boot, even though I quit before shutting down. I experience this on both Arch and the Kubuntu daily development release (JJ, to become 22.04).


STEPS TO REPRODUCE
1. Quit Konqueror
2. Shutdown
3. Restart

OBSERVED RESULT
Konqueror auto-starts

EXPECTED RESULT
It should not.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.89.0
Qt Version: 5.15.2
Kernel Version: 5.15.8-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i7 CPU M 620 @ 2.67GHz
Memory: 7.6 GiB of RAM
Graphics Processor: Mesa DRI Intel® HD Graphics

ADDITIONAL INFORMATION
Comment 1 Marco Parillo 2021-12-17 01:45:19 UTC
kInfoCenter for Kubuntu (with the same symptom):
Operating System: Kubuntu 22.04
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.89.0
Qt Version: 5.15.2
Kernel Version: 5.13.0-19-generic (64-bit)
Graphics Platform: X11
Processors: 2 × Intel® Core™ i7-8665U CPU @ 1.90GHz
Memory: 3.8 GiB of RAM
Graphics Processor: SVGA3D; build: RELEASE; LLVM;
Comment 2 Marco Parillo 2021-12-17 02:02:52 UTC
It seems as if the default has changed.
Settings > Configure Konqueror > KDE Performance > uncheck Always try to have one preloaded instance
resolved this for me.
Comment 3 Soren Stoutner 2022-10-28 11:32:27 UTC
In my opinion this should not be the default.  Having Konqueror preload every time KDE boots is not the desired behavior for the majority of users.  It is even worse that doing so causes Konqueror to display a window on the screen.
Comment 4 Stefano Crocco 2022-10-28 17:17:26 UTC
(In reply to Marco Parillo from comment #2)
> It seems as if the default has changed.
> Settings > Configure Konqueror > KDE Performance > uncheck Always try to
> have one preloaded instance
> resolved this for me.

The meaning of this option is different from what you think. What it should mean is the following: once you run Konqueror, keep one window ready to be displayed, even when the last window is closed. In theory, this shouldn't have any effect until you run Konqueror for the first time.

Whether an instance of Konqueror is created at startup or not is decided by another option, "preload an instance at desktop startup". The default for this option is false, which means that, in theory at least, unless you manually enable it, Konqueror should not be run at startup. I just checked logging in with a user whose home directory is empty and Konqueror wasn't run, as it should be.
Comment 5 local10 2022-10-29 00:54:41 UTC
> Konqueror should not be run at startup. I just checked
> logging in with a user whose home directory is empty and Konqueror wasn't
> run, as it should be.

I came across this bug recently[1] and for me a Konqueror window was showing up every time I logged in into KDE even though I wasn't using Konqueror (and had no Konqueror windows open) when I was logging out of KDE. It was pretty strange and annoying to see KDE to start opening a Konqueror window for seemingly no reason whatsoever. "Preload an instance at desktop startup" was OFF for me and it was still happening with the "Always try to have one preloaded instance" set to ON.

1 . https://lists.debian.org/debian-kde/2022/10/msg00051.html
Comment 6 Soren Stoutner 2022-10-29 22:31:52 UTC
I just did a bit of testing with the following results (testing was done with a Debian testing installation, which is currently running KDE Plasma 5.26.0 and Konqueror 21.12.3).


Konqueror does not open on every login when the following is true:

Preload an instance after desktop startup:  false
Always try to have one preloaded instance:  false

Preload an instance after desktop startup:  true
Always try to have one preloaded instance:  false

Preload an instance after desktop startup:  true
Always try to have one preloaded instance:  true


Konqueror opens on every login when the following is true:

Preload an instance after desktop startup:  false
Always try to have one preloaded instance:  true

In addition, there must be a running Konqueor instance when the user logged off (and KDE must be set to restore the last session).  However--and this is the kicker that makes this feel like a bug--Konqueror does not need to have a visible window when the user logged off for this to be triggered because closing all of Konqueror's windows does not actually close Konqueror.

So, my understanding of how this has happened.  1)  The defaults for Konqueror are set to `Preload an instance after desktop startup:  false` and `Always try to have one preloaded instance:  true`.  2)  A user is curious and opens Konqueror.  They then close it, but by default it continues to run in the background.  3)  Konqueror then opens up every time they log in going forward.  They close it every time and it pops back up on the next login.  They can't figure out why this is happening.

If the user manually kills the Konqueror instance before logging off it won't pop up again the next time.  Or, if a user unchecks `Always try to have one preloaded instance`, they can also get rid of this behavior.

Either way, it seems that this represents unintentional behavior.  I would assume that the default should be for `Always try to have one preloaded instance` to be false, as that is probably what the majority of users desire.
Comment 7 local10 2022-10-30 01:55:42 UTC
> So, my understanding of how this has happened.  1)  The defaults for Konqueror are set to `Preload an instance after desktop 
> startup:  false` and `Always try to have one preloaded instance:  true`.  2)  A user is curious and opens Konqueror.  They then 
> close it, but by default it continues to run in the background.  3)  Konqueror then opens up every time they log in going forward.  
> They close it every time and it pops back up on the next login.  They can't figure out why this is happening.

That's probably what happened. I don't use Konqueror all the time but occasionally I do use it.
Comment 8 Stefano Crocco 2022-10-30 10:59:21 UTC
I'm aware of this issue and I've already created a fix for it (https://invent.kde.org/network/konqueror/-/merge_requests/125). Unfortunately, it needs to be reviewed before it can be accepted. Until that is done, there's nothing I can do.

Of course, this is not how the preload mechanism should work. What should happen is the following:
- if you have the "Preload an instance after desktop startup" on, then when you log in KDE an hidden Konqueror window should be created (unless there are already visible windows from a previous session). This should happen regardless of the "Always try to have one preloaded instance" option.
- if you have the "Preload an instance after desktop startup" off, then no Konqueror window (hidden or not) should be created, except from the ones you left open from previous sessions. Again, this should be independent from the "Always try to have one preloaded instance" option.
- If you have the "Always try to have one preloaded instance" option on, then, once you run Konqueror, it will always create an extra, hidden window. This way, the next time you want a new window, it won't need to really create a new one: it'll just show the hidden one (which is faster), then create a new hidden one. This also happens when you close the last window: in that case, a new Konqueror application will be launched, with a single, hidden window (you can see this by running `ps x` after closing the last Konqueror window).
- If you have the "Always try to have one preloaded instance" option off, nothing of the above should happen. In particular, closing the last Konqueror window should also close the application.

If you're interested, below are some technical details about the cause of this bug.

Despite what one could image, the problem you're experiencing is not related to the "Preload an instance after desktop startup" option, but to the "Always try to have one preloaded instance" one and it's not caused by Konqueror itself, but rather by its interaction with the generic KDE session restoring feature. Essentially, when you close your session, the hidden window Konqueror creates when "Always try to have one preloaded instance" is on is registered by the KDE session manager, which then restores it when you next log in. Unfortunately, the session manager doesn't take into account the fact that the window was hidden, and it doesn't provide an easy way for Konqueror to tell it to ignore the preloaded windows.

This problem has appeared in recent years because in the past there used to be an instance of the Konqueror application for each window. Since it's easy to exclude application from session management, Konqueror could tell the session manager to ignore an instance if its window was hidden. Unfortunately, when we needed to change the main web engine Konqueror uses from KWebKitPart to QtWebEngine, we had to change how Konqueror works because QtWebEngine expects a single application instance, regardless of how many windows there are. We didn't realize that doing so would break how session management works, and this caused the bug you're experiencing.
Comment 9 Soren Stoutner 2022-10-31 16:13:05 UTC
Thank you for the detailed explanation.