By default, there is a little Audio Volume plasmoid in the System Tray that handles the volume keys on a laptop's keyboard. If you add a standalone Audio Volume plasmoid, that one takes over the keys. But then if you then delete it, the one in the System Tray doesn't regain control of the keys, so they stop working. This is 100% reproducible for me in Plasma 5.12.3 on Kubuntu 17.10.
Yes, that's how it works. In general, applets shouldn't register global shortcuts exactly for this reason - there can be multiple instances of one applet, but only one can have global shortcut registered at time. But of course, in this case, it is needed because there have to be global shortcuts for volume control. Proper way for global shortcuts is to handle them from daemon (eg. kded module), but plasma-pa doesn't have it. To fix this, it would be needed to track the lifetime of GlobalActions, add a proxy object and route the triggered signal only to one applet at time. I'm not sure if it is really worth fixing though. In 99.99% cases you won't hit this, only when you are playing with applets :D
I think it's a not-uncommon happenstance: you're playing around with the Widget Explorer because you're excited to see what Plasma has to offer and you try this one. You use it, realize it does exactly the same thing as the one in your system tray, so you remove it. Then your volume keys stop working. Gross. These kinds of little minefields where system functionality becomes broken when a curious user plays around are a huge usability problem and a source of the sense that "KDE is unstable!!!!11!" On another note, is there any way to make the keys work again without permanently re-adding the standalone plasmoid?
What do you mean with standalone plasmoid? For shortcuts working there must be at least one volume plasmoid. If you add another volume plasmoid which will take over the shortcuts and then remove it, you need to either add another volume plasmoid (eh) or restart plasmashell to make the shortcuts work again.
Yes, there is always at least one in the System Tray. And ah yes, killing and restarting plasmashell resolves the issue. Is there no sane and sensible way we can signal to plasmashell to reassign the keys after the second plasmoid is removed without killing and restarting it?
You can disable it in system tray, it is just enabled by default. plasmashell doesn't handle these shortcuts, it is done by applet itself with KGlobalAccel.
(In reply to David Rosca from comment #5) > You can disable it in system tray, it is just enabled by default. Right. The point is, if you add a second one, *something* should return the keys back to the first one without you having to restart plasmashell.
The thing is, there is no correct solution to this issue. Which applet should receive shortcut events if there is multiple applets? All of them? Only one - which one? If you say that the answer is "always send the shortcut event to one applet, doesn't matter which one", then it is incorrect. You can set maximum volume over 100% and this setting is separate for applet instances. Changing volumes with shortcut then honors this setting (and again, this can be different for each applet instance). So the solution is to move some parts (including shortcuts handling) to kded module or enforce at most one instance of plasma-pa applet, but as far as i know that is not supported by plasmashell.
Tricky problem. The last-added instance, maybe? That's what seems to happen right now. The only bug is that control doesn't shift back without restarting plasmashell. To me that seems like a reasonable-enough solution until we can do a larger re-architecture of this. Or just spitballing here: If you already have one instance and you add a second, could the second basically just act as a link to the first one, or use its configuration data? I'm not sure what the value is in having multiple volume plasmoids when they each have different settings. In fact I do set the maximum volume above 100%, and I was confused when I added the second one to see what it was and I found that it had the volume set back to 100% again. I expected it to inherit the configuration data from the original. Is there a use case for having multiple Plasmoids with different configuration data, or is this just a quirk of the implementation?
> Is there a use case for having multiple Plasmoids with different configuration data, or is this just a quirk of the implementation? Yes, pretty much all applets except plasma-pa wants this. That's how you can have launchers with different apps, clocks with different formatting, menus with different contents, etc...
Right right yeah. I should have written, "...for having multiple *Audio Volume* Plasmoids with different configuration data..."
Maybe just add a warning along the lines of "Disabling all Audio volume plasmoids will cause media- and volume keys to stop working, you might want to use 'Always hidden' instead." to the system tray configuration dialog until this works independently of the plasmoid?
*** Bug 449527 has been marked as a duplicate of this bug. ***
Is there a workaround for this? I'm using Kubuntu 22.04 LTS and probably went on the same journey as the OP whereby the volume control function keys stopped working. If I add an audio widget to my desktop then volume controls work again. But I don't want/need that widget because I already have a volume widget in the system tray. And if i remove the audio widget from the desktop the volume keys stop working again. Is there some way of tricking KGlobalAccel or whatever into handing / routing the audio function keys back to the system tray volume widget? I've experienced this on several laptops over the past 5+ years.
For anyone else experiencing this, the fix for me was to add the audio widget to my panel *alongside* my system tray, then configured my system tray audio volume to be "always hidden". That way, I only see one audio volume widget in my panel (I'm using latte dock, but same applies to the plain old KDE panel I reckon). So it seems the system tray audio volume widget was ignoring the audio control keyboard shortcuts.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-pa/-/merge_requests/221
*** Bug 478928 has been marked as a duplicate of this bug. ***
Git commit e7830539923c871243f07a055c6a8dd6dcc0fafd by Bharadwaj Raju. Committed on 16/03/2024 at 07:39. Pushed by bharadwaj-raju into branch 'master'. Create KDED service to handle global shortcuts and OSDs New KDED service which handles global shortcuts and OSDs, called "audioshortcutsservice". Now these functions don't depend on an applet existing. See plasma-desktop#113 M +1 -0 CMakeLists.txt D +0 -64 applet/contents/code/icon.js M +3 -5 applet/contents/ui/ListItemBase.qml M +16 -301 applet/contents/ui/main.qml M +46 -7 src/CMakeLists.txt A +54 -0 src/audioicon.cpp [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)] A +28 -0 src/audioicon.h [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)] R +0 -0 src/dbus/osdService.xml [from: src/qml/dbus/osdService.xml - 100% similarity] R +0 -0 src/globalconfig.kcfg [from: src/qml/globalconfig.kcfg - 100% similarity] R +1 -1 src/globalconfig.kcfgc [from: src/qml/globalconfig.kcfgc - 086% similarity] R +0 -0 src/globalconfigskeleton.h [from: src/qml/globalconfigskeleton.h - 100% similarity] M +4 -4 src/kcm/ui/MuteButton.qml D +0 -27 src/kcm/ui/icon.js A +22 -0 src/kded/CMakeLists.txt A +367 -0 src/kded/audioshortcutsservice.cpp [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)] A +51 -0 src/kded/audioshortcutsservice.h [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)] A +7 -0 src/kded/audioshortcutsservice.json A +2 -0 src/kded/audioshortcutsservice.json.license D +0 -55 src/qml/globalactioncollection.cpp D +0 -48 src/qml/globalactioncollection.h A +59 -0 src/qml/globalservice.cpp [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)] A +29 -0 src/qml/globalservice.h [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)] M +1 -0 src/qml/listitemmenu.cpp M +1 -1 src/qml/listitemmenu.h M +6 -7 src/qml/microphoneindicator.cpp M +3 -3 src/qml/microphoneindicator.h M +12 -5 src/qml/plugin.cpp D +0 -36 src/qml/volumeosd.cpp D +0 -24 src/qml/volumeosd.h R +0 -0 src/volumefeedback.cpp [from: src/qml/volumefeedback.cpp - 100% similarity] R +0 -0 src/volumefeedback.h [from: src/qml/volumefeedback.h - 100% similarity] https://invent.kde.org/plasma/plasma-pa/-/commit/e7830539923c871243f07a055c6a8dd6dcc0fafd