Bug 491509

Summary: System tray icon of Onboard (on-screen keyboard) not visible after upgrading to 6.1.4
Product: [Plasma] plasmashell Reporter: Guilherme Silva <oguilherme>
Component: System TrayAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: fanzhuyifan, kde, materka, nate
Priority: NOR Keywords: regression
Version: 6.1.4   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 6.1.5
Sentry Crash Report:

Description Guilherme Silva 2024-08-10 05:37:24 UTC
SUMMARY
After upgrading Plasma from 6.1.3 to 6.1.4, the tray icon provided by Onboard is not visible after you close its main window.


STEPS TO REPRODUCE
1. Launch "onboard-settings" (to enable the system tray icon feature)
2. Go to General, enable the "Show status icon" option
3. Under "Status icon provider", select "GtkStatusIcon (MATE)"
4. Close onboard-settings
5. Launch "onboard"
6. Hit the close button

OBSERVED RESULT
The icon of Onboard is not added to the system tray.

EXPECTED RESULT
Onboard should have its icon added to the system tray.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2
Kernel Version: 6.10.3-arch1-2 (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i5-3570K CPU @ 3.40GHz
Memory: 7.7 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 660/PCIe/SSE2

ADDITIONAL INFORMATION
I have not selected the exact KDE component because I'm not sure which one it is.

But here's the exact list of all system packages upgraded that introduced the issue:

hwdata (0.384-1 -> 0.385-1)
kdecoration (6.1.3-1 -> 6.1.4-1)
mpg123 (1.32.6-1 -> 1.32.7-1)
breeze (6.1.3-1 -> 6.1.4-1)
breeze-gtk (6.1.3-1 -> 6.1.4-1)
breeze5 (6.1.3-1 -> 6.1.4-1)
kactivitymanagerd (6.1.3-1 -> 6.1.4-1)
kde-cli-tools (6.1.3-1 -> 6.1.4-1)
kde-gtk-config (6.1.3-1 -> 6.1.4-1)
plasma-activities (6.1.3-1 -> 6.1.4-1)
kglobalacceld (6.1.3-1 -> 6.1.4-1)
layer-shell-qt (6.1.3-1 -> 6.1.4-1)
libkscreen (6.1.3-1 -> 6.1.4-1)
libplasma (6.1.3-1 -> 6.1.4-1)
kscreenlocker (6.1.3-1 -> 6.1.4-1)
kwayland (6.1.3-1 -> 6.1.4-1)
kwin (6.1.3-1 -> 6.1.4-1)
plasma-activities-stats (6.1.3-1 -> 6.1.4-1)
kpipewire (6.1.3-1 -> 6.1.4-1)
libksysguard (6.1.3-1 -> 6.1.4-1)
ksystemstats (6.1.3-1 -> 6.1.4-1)
milou (6.1.3-1 -> 6.1.4-1)
ocean-sound-theme (6.1.3-1 -> 6.1.4-1)
plasma5support (6.1.3-1 -> 6.1.4-1)
qqc2-breeze-style (6.1.3-1 -> 6.1.4-1)
xdg-desktop-portal-kde (6.1.3-1 -> 6.1.4-1)
plasma-integration (6.1.3-1 -> 6.1.4-1)
plasma-workspace (6.1.3-1 -> 6.1.4-1)
kdeplasma-addons (6.1.3-1 -> 6.1.4-1)
systemsettings (6.1.3-1 -> 6.1.4-1)
kinfocenter (6.1.3-1 -> 6.1.4-1)
kmenuedit (6.1.3-1 -> 6.1.4-1)
kwayland-integration (6.1.3-1 -> 6.1.4-1)
polkit-kde-agent (6.1.3-1 -> 6.1.4-1)
powerdevil (6.1.3-1 -> 6.1.4-1)
plasma-desktop (6.1.3-1 -> 6.1.4-1)
plasma-pa (6.1.3-1 -> 6.1.4-1)
plasma5-integration (6.1.3-1 -> 6.1.4-1)
Comment 1 fanzhuyifan 2024-08-10 17:08:08 UTC
I think this should be reported to onboard as onboard is responsible for not showing the decorations that allows users to terminate the program, thus removing the status icon.
Comment 2 Guilherme Silva 2024-08-10 17:30:07 UTC
I'm sorry, there must be a misunderstanding on your part because I'm failing to understand how this is Onboard's fault...

A lot of other popular programs also "minimize to tray" when you close them (e.g. Discord, KeepassXC, qBittorrent).

Besides, this functionality from Onboard worked just fine from KDE 5.x through 6.1.3.

Lastly, Onboard as a project is also pretty much "dead" (last commit was 7 years ago), so even if this had to be fixed on their side, I don't think it will be...
Comment 3 fanzhuyifan 2024-08-10 18:55:42 UTC
(In reply to Guilherme Silva from comment #2)
> A lot of other popular programs also "minimize to tray" when you close them
> (e.g. Discord, KeepassXC, qBittorrent).

These programs (steam, slack) work on my end. Basically it's the app's responsibility to not quit when the window close button is clicked, and there is nothing kwin/plasma could do if the onboard decides just to exit when the closed button is clicked.

> Lastly, Onboard as a project is also pretty much "dead" (last commit was 7
> years ago), so even if this had to be fixed on their side, I don't think it
> will be...

That's unfortunate but does not change the fact that a change is needed on their side.. If you are interested, maybe you could investigate and submit a patch to onboard?
Comment 4 Guilherme Silva 2024-08-10 22:01:28 UTC
(In reply to fanzhuyifan from comment #3)
> These programs (steam, slack) work on my end.

Sure, but I'm pretty sure they don't rely on the GtkStatusIcon spec, like I mentioned in my initial post...

> Basically it's the app's responsibility to not quit when the window close button is clicked, and
> there is nothing kwin/plasma could do if the onboard decides just to exit
> when the closed button is clicked.

Sure, but that's not the issue here. Before 6.1.4, just by launching Onboard, an icon would be added to systray.

After 6.1.4, that doesn't happen...

> That's unfortunate but does not change the fact that a change is needed on
> their side.. If you are interested, maybe you could investigate and submit a
> patch to onboard?

No, thanks, that would be rather pointless since the last commit was 7 years ago.

I do want to bisect this on KDE's side because this seems like a regression to me. However, KDE has a lot of subprojects and I'm not sure which one handles the system tray stuff.

Can you give me some pointers? Thank you.
Comment 5 Guilherme Silva 2024-08-10 22:12:25 UTC
Alright, so that was easier than expected: I just manually downgraded KWin  to 6.1.3 and I got the tray icon back. I'll do some bisecting next.
Comment 6 Guilherme Silva 2024-08-11 02:30:00 UTC
Just a small correction from my last email: The regression is in plasma-workspace, not KWin.

Here's the git bisect log between 6.1.3 (good) and 6.1.4 (bad):

>$ git bisect log 
>git bisect start
># status: waiting for both good and bad commits
># good: [0923ed4c15e3ef93c07bf63fc066256b0d7b736b] update version for new release
>git bisect good 0923ed4c15e3ef93c07bf63fc066256b0d7b736b
># status: waiting for bad commit, 1 good commit known
># bad: [b3d45d67ac99c4885646bccf9acc3db68005ba53] update version for new release
>git bisect bad b3d45d67ac99c4885646bccf9acc3db68005ba53
># good: [a26bf08fbca2c527c1eeedec32de9555f8fdcdf0] GIT_SILENT Sync po/docbooks with svn
>git bisect good a26bf08fbca2c527c1eeedec32de9555f8fdcdf0
># bad: [a70f71378eda8905ca5a160c1cea5b6cb2359bbd] GIT_SILENT Sync po/docbooks with svn
>git bisect bad a70f71378eda8905ca5a160c1cea5b6cb2359bbd
># bad: [2092fe8f2fada49ce23a52be722866c8cd98911d] Track screen change
>git bisect bad 2092fe8f2fada49ce23a52be722866c8cd98911d
># bad: [bf145579129e363cf14064bb369260c303b9ae23] xembed-sni-proxy: Check if descendant windows want button events
>git bisect bad bf145579129e363cf14064bb369260c303b9ae23
># good: [efca5810412709f3fda40c5eb75d024752b581fc] GIT_SILENT Sync po/docbooks with svn
>git bisect good efca5810412709f3fda40c5eb75d024752b581fc
># first bad commit: [bf145579129e363cf14064bb369260c303b9ae23] xembed-sni-proxy: Check if descendant windows want button events

Here's the link of the commit for easier assessment: https://invent.kde.org/plasma/plasma-workspace/-/commit/bf145579129e363cf14064bb369260c303b9ae23

Lastly, I kindly ask developers to reevaluate this bug report whenever possible.

Thanks.
Comment 7 David Redondo 2024-08-13 07:31:17 UTC
I checked out efca5810412709f3fda40c5eb75d024752b581fc and I dont get an icon 

I checkout out v6.1.3 and dont get an icon either

bf145579129e363cf14064bb369260c303b9ae23 braking it would have surprised me.

I noticed that onboard is running wayland natively  here, so of course  xembed GTKStatusIcon cant work 

After forcing to x11 with GDK_BACKEND=x11 I notice xembed-sni-proxy crashes.


A workaroung is using appindicator for its status icon
Comment 8 Bug Janitor Service 2024-08-13 07:41:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4601
Comment 9 David Redondo 2024-08-13 08:26:21 UTC
Git commit 85eb56e174bf887ccb8311e8f1a871e1ec453e04 by David Redondo.
Committed on 13/08/2024 at 07:39.
Pushed by davidre into branch 'master'.

xembedsniproxy: Guard against crash when xcb_query_tree_reply is null
FIXED-IN:6.1.5

M  +3    -0    xembed-sni-proxy/sniproxy.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/85eb56e174bf887ccb8311e8f1a871e1ec453e04
Comment 10 David Redondo 2024-08-13 09:31:29 UTC
Git commit dec0608369e1fe50685ce94113681ec9ed1bc43c by David Redondo.
Committed on 13/08/2024 at 09:09.
Pushed by davidre into branch 'Plasma/6.1'.

xembedsniproxy: Guard against crash when xcb_query_tree_reply is null
FIXED-IN:6.1.5


(cherry picked from commit 85eb56e174bf887ccb8311e8f1a871e1ec453e04)

Co-authored-by: David Redondo <kde@david-redondo.de>

M  +3    -0    xembed-sni-proxy/sniproxy.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/dec0608369e1fe50685ce94113681ec9ed1bc43c