Bug 450624 - --preload argument causes full app to be launched
Summary: --preload argument causes full app to be launched
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 451310 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-02-20 18:49 UTC by Petr N.
Modified: 2022-11-09 16:28 UTC (History)
6 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 Petr N. 2022-02-20 18:49:51 UTC
Debian stable (11) up to date
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0

In my case it is starting Konqueror repeatedly and i am always closing it on time before reboot or reset. I am not using this browser and not aware i would have given KDE permission to auto-start it.

Details:
https://forum.kde.org/viewtopic.php?t=90342
https://forums.debian.net/viewtopic.php?f=30&t=149787
Comment 1 Nate Graham 2022-02-21 23:17:53 UTC
So Konqueror is auto-starting on login?

Is it listed in System Settings > Startup & Shutdown > Autostart?

It is secretly running in the background? ksysguard will tell you.
Comment 2 Petr N. 2022-02-22 08:25:30 UTC
> So Konqueror is auto-starting on login?
I suppose, because i see it always right after desktop interface start.
 
> Is it listed in System Settings > Startup & Shutdown > Autostart?
No

> It is secretly running in the background? ksysguard will tell you.
I am unable to find match once its window is closed, the process matching search query "onq" disappear
Comment 3 Nate Graham 2022-02-28 22:02:38 UTC
Thanks. Is there anything in ~/.config/autostart/? If there is, can you open each file and inspect its contents to see if it might be launching konqueror? After that, do the same for /etc/xdg/autostart/. It's gotta be getting launched by *something*! :)
Comment 4 Petr N. 2022-02-28 23:01:53 UTC
(In reply to Nate Graham from comment #3)

If You mean to lookup content of the files inside ~/.config/autostart/ and /etc/xdg/autostart/ directories, i did command "grep -Ri onq ~/.config/autostart/ /etc/xdg/autostart/" and only file containing onq (part of konqueror) was /etc/xdg/autostart/konqy_preload.desktop which content is here https://bin.disroot.org/?0768f3639a2628ae#Adj1S5MamJ3pX8TVTvYAoHuxhmhbMSgKBCVsQvcwnmhg ...
Comment 5 Nate Graham 2022-03-01 04:52:31 UTC
That's probably it. What package provides it? You can see with `dpkg -S konqy_preload.desktop`
Comment 6 Petr N. 2022-03-01 08:04:44 UTC
(In reply to Nate Graham from comment #5)

$ dpkg -S konqy_preload.desktop
konqueror: /etc/xdg/autostart/konqy_preload.desktop

$ sudo apt info konqueror
Package: konqueror
Version: 4:20.12.0-4
Priority: optional
Section: web
Maintainer: Debian/Kubuntu Qt/KDE Maintainers <debian-qt-kde A-T lists.debian.org>
...
Homepage: https://apps.kde.org/en/konqueror
...
APT-Manual-Installed: no
APT-Sources: http://deb.debian.org/debian bullseye/main amd64 Packages

full output: https://bin.disroot.org/?ae2c536c2eddbec1#8gfsJ4mfRE1tMkJUVyhontM4vYeLLfSZWTezK4H3qE8X
...?
Comment 7 Nate Graham 2022-03-01 20:43:26 UTC
OK, so what seems to be happening is that Konqueror's --preload argument is not working properly and causes the full app to be launched, instead of simply cached to memory. Moving to Konqueror.
Comment 8 Nate Graham 2022-03-31 19:04:13 UTC
*** Bug 451310 has been marked as a duplicate of this bug. ***
Comment 9 Stefano Crocco 2022-04-10 18:52:11 UTC
The problem is indeed caused by Konqueror itself. However, the problem is not the --preload argument not working (you can check that launching konqueror --preload from the command line doesn't display the window); what is not working is session management. I tried looking into this issue today and my impression is that session management in Konqueror is built around the idea that there's one Konqueror application for each window, which I think was the case when the default web engine were kthml and wkebkitpart. However, when Konqueror switched to QtWebEngine, this was changed and now there's always one instance of Konqueror, regardless of the number of windows. The session management code, however, wasn't changed accordingly, which leaded to this issue.

I'll try to fix this issue as soon as possible, but I fear it'll take some time because there might be a lot of things to change. In the meanwhile, a workaround for this behavior is to go to Konqueror settings dialog and disable the "Preload instance after desktop startup" option in the "KDE performance" tab. After that, kill all the Konqueror instances with a `killall konqueror` from the command line.
Comment 10 Bug Janitor Service 2022-06-26 16:39:28 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/konqueror/-/merge_requests/125
Comment 11 Stefano Crocco 2022-11-09 14:42:21 UTC
Git commit 26d9806132fc8b9267bfe6ae89f59a1a74bc7f03 by Stefano Crocco.
Committed on 09/11/2022 at 13:57.
Pushed by stefanocrocco into branch 'master'.

Fix session management with preloaded windows

Session management stopped working corectly with preloaded windows when
Konqueror was ported from having many application instances to a single
application with many windows. The session management code wasn't
changed accordingly, which caused preloaded windows to be restored as
full windows.

To correctly exclude preloaded windows from session management, we use
KMainWindow::saveGlobalProperties to store the indexes of preloaded
windows and KMainWindow::readGlobalProperties to read them back, so that
we know which windows should not be restored.

This commit also refactors much of the startup code, moving it from
main() to KonqApplication.

M  +333  -2    src/konqapplication.cpp
M  +27   -0    src/konqapplication.h
M  +3    -262  src/konqmain.cpp
M  +23   -0    src/konqmainwindow.cpp
M  +4    -0    src/konqmainwindow.h
M  +24   -12   src/konqmainwindowfactory.cpp
M  +5    -0    src/konqmainwindowfactory.h
M  +36   -1    src/konqsessionmanager.cpp
M  +5    -0    src/konqsessionmanager.h

https://invent.kde.org/network/konqueror/commit/26d9806132fc8b9267bfe6ae89f59a1a74bc7f03
Comment 12 Stefano Crocco 2022-11-09 16:28:17 UTC
Git commit 75d3c02aee2cc0c9742d4a79e30db77b9fcafc50 by Stefano Crocco.
Committed on 09/11/2022 at 16:28.
Pushed by stefanocrocco into branch 'release/22.12'.

Fix session management with preloaded windows

Session management stopped working corectly with preloaded windows when
Konqueror was ported from having many application instances to a single
application with many windows. The session management code wasn't
changed accordingly, which caused preloaded windows to be restored as
full windows.

To correctly exclude preloaded windows from session management, we use
KMainWindow::saveGlobalProperties to store the indexes of preloaded
windows and KMainWindow::readGlobalProperties to read them back, so that
we know which windows should not be restored.

This commit also refactors much of the startup code, moving it from
main() to KonqApplication.


(cherry picked from commit 26d9806132fc8b9267bfe6ae89f59a1a74bc7f03)

M  +333  -2    src/konqapplication.cpp
M  +27   -0    src/konqapplication.h
M  +3    -262  src/konqmain.cpp
M  +23   -0    src/konqmainwindow.cpp
M  +4    -0    src/konqmainwindow.h
M  +24   -12   src/konqmainwindowfactory.cpp
M  +5    -0    src/konqmainwindowfactory.h
M  +36   -1    src/konqsessionmanager.cpp
M  +5    -0    src/konqsessionmanager.h

https://invent.kde.org/network/konqueror/commit/75d3c02aee2cc0c9742d4a79e30db77b9fcafc50