Bug 502019 - Left-clicking "Screen Casting" tray item (e.g. while recording with OBS) produces a context menu as a standalone window
Summary: Left-clicking "Screen Casting" tray item (e.g. while recording with OBS) prod...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: System Tray widget (show other bugs)
Version: 6.3.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2025-03-26 13:02 UTC by Patrick Silva
Modified: 2025-04-10 07:28 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.4
Sentry Crash Report:


Attachments
screenshot (63.49 KB, image/png)
2025-03-26 13:02 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2025-03-26 13:02:14 UTC
Created attachment 179752 [details]
screenshot

STEPS TO REPRODUCE
1. open OBS Studio
2. click on the red circle icon in the system tray
3. 

OBSERVED RESULT
the tiny window seen in the attached screenshot opens

EXPECTED RESULT
no window opens and the screen sharing stops

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2
Graphics Platform: Wayland
Comment 1 Nate Graham 2025-03-26 15:15:51 UTC
Looks like this menu doesn't have a parent set properly, so it appears as a window.

This is an app bug, but I thought there was a workaround or fix in Qt, and OBS is a QT-based app.

Is your OBS from distro packages, and therefore using the system Qt version?
Comment 2 Patrick Silva 2025-03-26 15:19:36 UTC
My OBS is installed from Arch repos. I can also reproduce with Kooha, a gtk4 screen recorder.
Comment 3 Zamundaaa 2025-03-27 14:51:53 UTC
This tray item isn't from OBS, it's from our xdg desktop portal. This won't be a bug in there either though; plasmashell is responsible for showing system tray menus (of Wayland apps)
Comment 4 Nate Graham 2025-03-27 16:41:03 UTC
Can reproduce it, FWIW.
Comment 5 David Redondo 2025-04-01 08:16:26 UTC
> This tray item isn't from OBS, it's from our xdg desktop portal. This won't be a bug in there either though; plasmashell is responsible for showing system tray menus (of Wayland apps)

That is true and works on right click. But what the portal does is it also wants to show on left click so it shows it itself.

This is fixable by making "ItemIsMenu" settable in Kstatusnotifieritem, then plasmashell will also show the menu on left click. Or we come up with a better pattern, as a single item menu might not be the best anyway?
Comment 6 Nate Graham 2025-04-01 14:36:04 UTC
(In reply to David Redondo from comment #5)
> This is fixable by making "ItemIsMenu" settable in Kstatusnotifieritem, then
> plasmashell will also show the menu on left click. Or we come up with a
> better pattern, as a single item menu might not be the best anyway?

I think that got implemented in https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5332, right?
Comment 7 David Redondo 2025-04-01 15:31:10 UTC
Yes but kstatusnotifieritem does not allow "ItemisMenu" at the moment https://invent.kde.org/frameworks/kstatusnotifieritem/-/blob/master/src/kstatusnotifieritemdbus_p.cpp?ref_type=heads#L159
Comment 8 Bug Janitor Service 2025-04-07 09:23:38 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kstatusnotifieritem/-/merge_requests/37
Comment 9 Bug Janitor Service 2025-04-07 09:25:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/375
Comment 10 David Redondo 2025-04-09 14:51:03 UTC
Git commit 80331812322720190141ee686bad805b757d78c4 by David Redondo.
Committed on 09/04/2025 at 14:23.
Pushed by davidre into branch 'master'.

Add KStatusNotifierItem::isMenu

this allows modifying the ItemIsMenu hint from the spec.

M  +10   -0    src/kstatusnotifieritem.cpp
M  +17   -0    src/kstatusnotifieritem.h
M  +1    -1    src/kstatusnotifieritemdbus_p.cpp
M  +1    -0    src/kstatusnotifieritemprivate_p.h

https://invent.kde.org/frameworks/kstatusnotifieritem/-/commit/80331812322720190141ee686bad805b757d78c4
Comment 11 David Redondo 2025-04-10 07:28:06 UTC
Git commit 7b6d1a6538118b52e2159206edf9d3af3c89c958 by David Redondo.
Committed on 10/04/2025 at 07:24.
Pushed by davidre into branch 'master'.

screencast: Set KStatusNotifierItem::isMenu

This way plasmashell will show the menu on left click and we dont
have to do it ourselves.
FIXED-IN: 6.4

M  +1    -1    src/session.cpp

https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/7b6d1a6538118b52e2159206edf9d3af3c89c958