Bug 475128

Summary: akregator / kmail : can't restore / reduce to tray
Product: [Applications] akregator Reporter: Christophe Marin <christophe>
Component: generalAssignee: kdepim bugs <pim-bugs-null>
Status: REPORTED ---    
Severity: normal CC: aacid, bruno+kde, Chain, goliash, groszdanielpub, heiko, jjm, kde, kermit, muziofg, petermayr, philippe.roubach, shawn.peterson, tabibi, tia3100, trent2, yule2000
Priority: NOR Keywords: qt6
Version First Reported In: GIT (master)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=482440
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Christophe Marin 2023-10-02 11:24:54 UTC
Using master builds.
reducing and restoring the akregator or kmail window using the tray icon doesn't work anymore.

akregator has less settings so reproducing is easier with it.

What works:
- deleting akregatorrc
- launching akregator
- in settings, disable tray icon / application / enable tray icon / apply
- the window can then be hidden/restored with the tray icon

but after quitting  / restarting akregator, the issue is back.
Comment 1 Arek Guzinski 2024-03-05 21:01:46 UTC
Same thing here on current neon -- but only with akregator. Works fine in kmail.
Maybe it's fixed there and that fix can be applied to akregator?
Comment 2 Bruno P. 2024-03-10 15:58:18 UTC
Same behavior with kmail/kontact using KDE Neon User edition.
Comment 3 Bruno P. 2024-03-10 15:59:37 UTC
*** Bug 482440 has been marked as a duplicate of this bug. ***
Comment 4 Bruno P. 2024-03-29 17:11:21 UTC
*** Bug 483656 has been marked as a duplicate of this bug. ***
Comment 5 Bruno P. 2024-03-29 17:11:42 UTC
*** Bug 484232 has been marked as a duplicate of this bug. ***
Comment 6 Timothy B 2024-04-03 13:17:38 UTC
This started happening to me since I upgraded to Plasma 6 and KDE Gear 24.02, and the workarounds mentioned in the initial comment work perfectly on my end. But then again, the issue returns the next time I relaunch Akegrator or when it autostarts at login.

Also, given the number of duplicates we have linked to this report so far, I think it's safe to say that this bug should be marked as confirmed.
Comment 7 Christophe Marin 2024-04-08 10:25:05 UTC
If you still have this issue can you retry once your distro provides Qt 6.7.0.  Some related changes were pushed (https://bugreports.qt.io/browse/QTBUG-121398 for the details)
Comment 8 Philippe ROUBACH 2024-04-11 11:24:52 UTC
problem still there with qt 6.7
Comment 9 evil-god 2024-05-27 17:14:07 UTC
problem still there with qt 6.7.1
Comment 10 Philippe ROUBACH 2024-05-30 06:32:31 UTC
Problem fixed with akregator.

Problem still there with kmail icon. Clicking the icon does not display kontact.
Comment 11 Timothy B 2024-08-28 20:00:39 UTC
Still reproducible with Akregator 24.08.0
Comment 12 Richard Homonnai 2024-09-07 17:49:28 UTC
Just switched to Plasma 6 on Gentoo. Kmail/Kontact is unusable now.

Problem still persists with Qt 6.7.2
Comment 13 Philippe ROUBACH 2024-09-10 11:35:34 UTC
I made this experiment about kmail icon in the systray.

I made a clean installation of openSUSE Tumbleweed.

In kmail
- I add an identity and its input account and output account.
- I check that clicking the kmail icon on the systray opens the kontact window.
Then
- I add a second identity and its output and input account.
- I check that clicking the kmail icon on the systray does open the kontact window.
Comment 14 Ray 2024-12-17 12:37:04 UTC
*** Bug 487025 has been marked as a duplicate of this bug. ***
Comment 15 Ray 2024-12-17 12:40:32 UTC
clicking kmals systray icon gives:
kf.windowsystem: KWindowInfo is only functional when running on X11
kf.windowsystem: static int KX11Extras::currentDesktop() may only be used on X11
Comment 16 Ray 2024-12-17 12:50:28 UTC
for some reason systrayicon works for kmail but not for kontact
Comment 17 Grósz Dániel 2024-12-17 13:14:25 UTC
(In reply to Ray from comment #15)
> clicking kmals systray icon gives:
> kf.windowsystem: KWindowInfo is only functional when running on X11
> kf.windowsystem: static int KX11Extras::currentDesktop() may only be used on
> X11

Clicking the Mail systray icon doesn't restore Kontact on X11 either for me. (It does activate the window if it's already open.)

Also, the Akregator systray icon does work to restore it on X11 whether it's running as a standalone application or as part of Kontact; the KMail systray icon works if it's a standalone app but not as part of Kontact.

Are we sure this is actually the same  Bug 487025, which has just been marked as a duplicate of it? This bug has originally reported for Akregator, which works for me (on X11) either standalone or via Kontact.
Comment 18 Francesco 2025-12-29 20:24:05 UTC
I can confirm, recently I have jump from Debian 12 (Plasma 5) to the new stable release (Plasma 6) and experienced the described bug for Akregator application. It happens with both wayland and xorg (but also on X11 the tool "inxi" tells me that Xwayland is used, I don't know why)

But I would share here my workaround, can be also useful to indentify the root cause of the bug:

In my setup akregator was always starting together the restore of the last session, in plasma 6 this cause showing a tray icon unable to interact to show/hide the application, also its context menu lacks of the menu item restore/minimize. 
To solve flawlessly I have:
- blacklisted Akregator on restore session option, both desktop file and executable path with the string "org.kde.akregator.desktop:/usr/bin/akregator" as exluded applications from the restore
- added Akregator as autostart application and added the parameter --hide-mainwindow to start the application as a tray icon

surprisingly this workaround works, now the tray icon can show/hide Akregator
Comment 19 Ray 2025-12-29 21:41:14 UTC
Thank you for the workaround for akregator. Unfortunately kontact doesn't have the --hide-mainwindow option.
I've given up using kontact and am using kmail only on ubuntu and fedora kde as both distros have the same issue (while running wayland at least)

But I have to admit, it's really annoying, as kmail obviously doesn't come with korganizer, and korganizer has no tray-icon - so if you want mails and calendar in tray you can't live without kontact.

With the kontact-icon being hit, terminal gives back following when trying to use it:
kf.windowsystem: KWindowInfo is only functional when running on X11
kf.windowsystem: static int KX11Extras::currentDesktop() may only be used on X11

I'll throw a party if this get's solved!
Comment 20 Albert Astals Cid 2025-12-29 22:56:19 UTC
Akregator seems like it would be bug 494071 and should be fixed for 25.12.1
Comment 21 Bug Janitor Service 2025-12-29 23:52:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/kmail/-/merge_requests/187
Comment 22 Francesco 2025-12-30 12:58:08 UTC
(In reply to Ray from comment #19)
> Thank you for the workaround for akregator. Unfortunately kontact doesn't
> have the --hide-mainwindow option.

each application have a different named option
kmail has --startintray
kontact has --iconify
Comment 23 Albert Astals Cid 2025-12-31 09:06:56 UTC
Git commit 0851dc47c1f271bd6a1e872469c446de7521ba8a by Albert Astals Cid.
Committed on 31/12/2025 at 08:55.
Pushed by aacid into branch 'master'.

Make the KMail system tray button work when on kontact

M  +1    -0    src/kmail_part.cpp

https://invent.kde.org/pim/kmail/-/commit/0851dc47c1f271bd6a1e872469c446de7521ba8a