Bug 494071 - Clicking on system tray icon does not open main window, "Restore" missing from context menu
Summary: Clicking on system tray icon does not open main window, "Restore" missing fro...
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (other bugs)
Version First Reported In: 6.2.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-03 22:42 UTC by Aleksey Kontsevich
Modified: 2025-12-16 13:15 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aleksey Kontsevich 2024-10-03 22:42:26 UTC
SUMMARY
2 issues found:
1) If Akregator tray icon set to "Automatic" in Plasma Panel settings then pressing to the icon has no effect: no window popup or hide. If it is always visible - works normal: 1 click - window pops up, 2nd time - hides.
2) No unread feeds number on the tray icon.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20241002
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.11.0-1-default (64-bit)
Graphics Platform: X11
Comment 1 Aleksey Kontsevich 2024-10-03 22:47:52 UTC
Also Restore/Minimize tray icon menu items were absent. Now they are shown. Now set tray icon visibility back to "Automatic" - works normal again: 1 click - window pops up, 2nd time - hides. Weird!
Comment 2 Aleksey Kontsevich 2024-10-04 12:38:13 UTC
(In reply to Aleksey Kontsevich from comment #0)
> 1) If Akregator tray icon set to "Automatic" in Plasma Panel settings then
> pressing to the icon has no effect: no window popup or hide. 
> Also Restore/Minimize tray icon menu items were absent.

This always happens after login and session restore. So I assumes it restores incorrectly some how. If I restart Akregator or change tray icon visibility "Always visible"<->"Automatic" Restore/Minimize menu item appears and mouse clicks on the icon work again.

May be related to BUG 487912. May be not.
Comment 3 Brendon Higgins 2025-03-05 16:30:28 UTC
I'm also finding that behaviour, especially where if Akregator is minimized to the tray icon at logout, when the session is restored at login Akregator will be in the tray but will not restore the main window from clicking the icon. I can even open the settings using the icon's RMB context menu, but that doesn't help. I have to quit Akregator and restart it each time - an easy if annoying workaround, and defeats the purpose of session restoration functionality.

My guess would be that perhaps Akregator has some internal state to keep track of whether its window is minimized to the tray icon or not, and that state is not correctly initialized when the session is restored with the window starting in the minimized condition.

Info copied from About/Components page:
Akregator: 6.3.2 (24.12.2)
KDE Frameworks: 6.11.0
Qt: Using 6.7.2 and built against 6.7.2
Debian GNU/Linux trixie/sid (Xcb)
Build ABI: x86_64-little_endian-lp64
Kernel: linux 6.12.12-amd64
Comment 4 Jonathan Marten 2025-03-06 09:43:15 UTC
The number of unread articles not being shown on the tray icon is intentional, see bug 377485.

The system tray icon not opening the main window when clicked, and the context menu missing the "Restore" item, can be confirmed with current master and starting Akregator from the command line - no new login or session restore is needed.

Operating System: Gentoo 2.17
KDE Plasma Version: 6.3.80
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.1
Kernel Version: 6.6.47-gentoo-x86_64 (64-bit)
Graphics Platform: X11
Processors: 3 × AMD Phenom(tm) II X3 705e Processor
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GT 730
Comment 5 Bug Janitor Service 2025-03-06 14:33:53 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/akregator/-/merge_requests/63
Comment 6 Jonathan Marten 2025-03-10 08:10:39 UTC
Git commit 37472c0e2ffbf539b697888ed1131571a6a231e3 by Jonathan Marten.
Committed on 10/03/2025 at 08:10.
Pushed by marten into branch 'master'.

Re-register the MainWindow with the system tray icon if its window handle changes

This is initially set as the KStatusNotifierItem's associated window,
but further on during startup the window gets destroyed and recreated.
This happens during the initialisation of the article viewer, somewhere
deep within QWebEngine. Since the KStatusNotifierItem retains the
associated window using its window handle, that association is lost.
The symptom is that the tray icon menu does not have a "Restore" item
and clicking on the icon does not open the main window.

The event filter monitors the MainWindow's window handle and, if it changes
(either during startup or while running) for any reason, re-registers it as
the tray icon's associated window.

M  +27   -3    src/main.cpp

https://invent.kde.org/pim/akregator/-/commit/37472c0e2ffbf539b697888ed1131571a6a231e3
Comment 7 Jonathan Marten 2025-03-10 08:19:20 UTC
Git commit 4d04eedb66483725974f807b1d39aed91523b674 by Jonathan Marten.
Committed on 10/03/2025 at 08:11.
Pushed by marten into branch 'release/25.04'.

Re-register the MainWindow with the system tray icon if its window handle changes

This is initially set as the KStatusNotifierItem's associated window,
but further on during startup the window gets destroyed and recreated.
This happens during the initialisation of the article viewer, somewhere
deep within QWebEngine. Since the KStatusNotifierItem retains the
associated window using its window handle, that association is lost.
The symptom is that the tray icon menu does not have a "Restore" item
and clicking on the icon does not open the main window.

The event filter monitors the MainWindow's window handle and, if it changes
(either during startup or while running) for any reason, re-registers it as
the tray icon's associated window.

(cherry picked from commit 37472c0e2ffbf539b697888ed1131571a6a231e3)

M  +27   -3    src/main.cpp

https://invent.kde.org/pim/akregator/-/commit/4d04eedb66483725974f807b1d39aed91523b674
Comment 8 Aleksey Kontsevich 2025-04-20 14:14:08 UTC
Where that was fixed?! Today updated to Akregator version 6.4.0 (25.04.0) - issue still there.

Operating System: openSUSE Tumbleweed 20250418
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.13.0
Qt Version: 6.9.0
Kernel Version: 6.14.2-1-default (64-bit)
Graphics Platform: X11
Comment 9 Aleksey Kontsevich 2025-07-29 08:23:43 UTC
When this issue will be fixed?! Happens every day!!!
Comment 10 Aleksey Kontsevich 2025-10-28 06:14:27 UTC
Any chance to fix this?!
Comment 11 Brendon Higgins 2025-12-14 03:40:02 UTC
Indeed, clicking the icon in the tray still doesn't work for me until I quit and restart Akregator.

Akregator: 6.5.3 (25.08.3)
KDE Frameworks: 6.20.0
Qt: Using 6.9.2 and built against 6.9.2
Debian GNU/Linux forky/sid (Xcb)
Build ABI: x86_64-little_endian-lp64
Kernel: linux 6.17.9+deb14-amd64
Comment 12 Albert Astals Cid 2025-12-14 09:36:39 UTC
> Indeed, clicking the icon in the tray still doesn't work for me until I quit and restart Akregator.

What do you mean it does not work until you quit and restart? You have to start akregator twice to make it work? Or?

Can you please give a full step by step description of what you do so that it does not work?
Comment 13 Aleksey Kontsevich 2025-12-14 15:52:06 UTC
(In reply to Albert Astals Cid from comment #12)
> > Indeed, clicking the icon in the tray still doesn't work for me until I quit and restart Akregator.
> 
> What do you mean it does not work until you quit and restart? You have to
> start akregator twice to make it work? Or?
> 
> Can you please give a full step by step description of what you do so that
> it does not work?

Have You read Comment 2?! No "Restore" option in tray menu and clicking on the tray icon has no effect - no window restore - still minimized to tray. After Quit and restart Akregator again - everything works again.
Comment 14 Brendon Higgins 2025-12-14 17:57:10 UTC
While I don't want to reinforce the demanding tone, ultimately Aleksey is right, earlier comments describe this. For expediency, though, I'll summarize the steps I take to reproduce:
1. Begin with a Plasma session where Akregator is running but minimized to the tray. Session saving and restoration is on.
2. Log out and then log in to a new (restored) Plasma session. Akregator starts (its icon appears in the tray) but no main window appears.
3. Left-click Akregator icon in the tray. It gives the standard "pressed" animation, but nothing else happens.
4. Right-click the Akregator icon in the tray. Context menu has "Fetch All Feeds", "Configure Akregator...", and "Quit", but no option to restore the window.
5. Note there's no way to restore the main Akregator window at this point, so Quit Akregator.
6. Start Akregator again. Main window appears, as well as the tray icon. Now the RMB context menu has the "Restore"/"Minimize" option, and left-clicking works to both hide and restore the main window as expected.
Comment 15 Albert Astals Cid 2025-12-15 23:34:21 UTC
I was ready to ignore this bug. Please be nice to people that are spending their hobby time helping you, otherwise i just go somewhere else where i am not mistreated.

Aleksey, you can thank Brendon for being a nice person.
Comment 16 Bug Janitor Service 2025-12-15 23:34:47 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/akregator/-/merge_requests/70
Comment 17 Forest 2025-12-15 23:51:14 UTC
Thank you for not ignoring the bug, Albert. Some of us here do understand what it means to donate one's time to the public service of open software, even if we are usually silent.

This is perhaps a good reminder to everyone: kindness is important, even when we're feeling frustrated.
Comment 18 Albert Astals Cid 2025-12-16 11:08:35 UTC
Git commit f8e450699a5cf1b878c38ac4eab9504fc0bf05fb by Albert Astals Cid.
Committed on 15/12/2025 at 23:32.
Pushed by aacid into branch 'master'.

Fix restore main window not being registered with the system tray

M  +5    -4    src/main.cpp

https://invent.kde.org/pim/akregator/-/commit/f8e450699a5cf1b878c38ac4eab9504fc0bf05fb
Comment 19 Albert Astals Cid 2025-12-16 11:09:10 UTC
Git commit 9d9c5cc4e3a8be4e1cb71f1d9ccc709f15448c13 by Albert Astals Cid.
Committed on 16/12/2025 at 11:08.
Pushed by aacid into branch 'release/25.12'.

Fix restore main window not being registered with the system tray
(cherry picked from commit f8e450699a5cf1b878c38ac4eab9504fc0bf05fb)

M  +5    -4    src/main.cpp

https://invent.kde.org/pim/akregator/-/commit/9d9c5cc4e3a8be4e1cb71f1d9ccc709f15448c13
Comment 20 Aleksey Kontsevich 2025-12-16 13:15:47 UTC
(In reply to Albert Astals Cid from comment #18)
> Git commit f8e450699a5cf1b878c38ac4eab9504fc0bf05fb by Albert Astals Cid.
> Committed on 15/12/2025 at 23:32.
> Pushed by aacid into branch 'master'.
> 
> Fix restore main window not being registered with the system tray
> 
> M  +5    -4    src/main.cpp
> 
> https://invent.kde.org/pim/akregator/-/commit/
> f8e450699a5cf1b878c38ac4eab9504fc0bf05fb

Bad style to move Akregator::MainWindow *mMainWindow out of private section - better wrap it into a getter method.