Summary: | Have kded or plasmashell handle media-related keyboard shortcuts so they don't stop working when all Audio Volume applet/widget instances are removed or when more than one is present | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | 8192 |
Component: | Media Player widget | Assignee: | Kai Uwe Broulik <kde> |
Status: | RESOLVED FIXED | ||
Severity: | task | CC: | arnecruz0, bharadwaj.raju777, cabanur, chermnykh2001, karl, kde, m.orly97, nate, peter, plasma-bugs, sephiroth_pk |
Priority: | NOR | ||
Version: | 5.16.5 | ||
Target Milestone: | 1.0 | ||
Platform: | Manjaro | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=391578 | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Bug Depends on: | |||
Bug Blocks: | 485384, 443036 |
Description
8192
2019-06-25 22:23:06 UTC
Works for me, FWIW. Does Elisa not use the Application Media Controller? If I go into Configure Elisa > set Media Play for Play-Pause, I see the dialog, "The shortcut 'Media Play' conflicts with the following key combination: Shortcut 'Media Play' in Application Media Controller for action Play/Pause media playback" Not to mention that Elisa would only respond to this key if raised (in focus), unlike any other player (Clementine, mpv, etc.). I just experienced this today, and discovered the issue was that plasma-browser-integration has grabbed the media keys for a YouTube video. You can check this by showing the Media Player system applet item and seeing what it shows. If Elisa is playing music, but another app/audio source is listed in the Media Player applet, that's the problem. Can you see if this is what's happening? I have Clementine and a YouTube video playing in the background. I started Elisa and play a song. I see Elisa and the song it's playing in the Media Player tray widget: https://i.imgur.com/5P82Eq6.png I also see the same in the default Media Player plasmoid: https://i.imgur.com/a6qq3S0.png However, while I'm seeing this, my media keys still only manipulate Clementine. This is whether Elisa is in or out of focus. If I close Clementine, the "Choose player automatically" dropdown disappears from both the Media Player tray widget and the plasmoid, and now media keys don't do anything because Elisa doesn't respond to them. ... And now, Elisa suddenly responds to them! I have no idea what changed. With Clementine closed, it still wouldn't respond to media keys for a little there. Then I clicked on Elisa to focus on it again, and now the media keys work, in and out of focus! It's a mixed bag as to who (between Clementine and Elisa) gets the keys when they're both open, but, until now, Elisa didn't respond no matter what. So... Yay! I guess that wasn't it. Thanks for the info! Is it still working for you? I'm getting the feeling that this is related to how the Media Player plasmoid handles multiple MPRIS data sources. Moving there for further comment. It's still working. You may be right about the plasmoid -- a while ago, I think I discovered another clue, but regretfully didn't report in and may be mistaken now: if I booted with the Media Player thingy in my tray (the "plasmoid"?) disabled from "Configure System Tray...", Elisa would start and not respond to media controls until the Media Player in the tray was re-enabled. Maybe this is why I initially ran into the issue because, usually, I always had it disabled since I never needed it. Of course, I can't try to replicate; I have way too many tabs open and things. :3 Currently, I'm on a boot in which the Media Player was left enabled. If I disable the Media Player, Elisa's media keys still work, and I *believe* this was also the case back then. It just needed to be enabled once for media keys to work. (In reply to 8192 from comment #10) > You may be right about the plasmoid -- a while ago, I think I discovered > another clue, but regretfully didn't report in and may be mistaken now: > > if I booted with the Media Player thingy in my tray (the "plasmoid"?) > disabled from "Configure System Tray...", Elisa would start and not respond > to media controls until the Media Player in the tray was re-enabled. Maybe > this is why I initially ran into the issue because, usually, I always had it > disabled since I never needed it. Yep, it sounds like this is exactly the issue, which I can both reproduce and explain: it's because the Media Player applet/widget is what handles media keys. If you remove all of them, nothing is left to handle the media keys. The same thing happens to your volume keys if you remove or disable all instances of the Audio Volume applet/widget (See Bug 391578). A solution might be to have the kded deamon or even plasmashell itself register these keys so you don't lose functionality if you opt to disable system tray applets without adding their widget versions. Kai, would it be feasible to move media key handling out of the Media Player applet/widget and into kded or plasmashell or somewhere else? Though then I suppose the downside would be that in the KGlobalAccel KCM, the shortcuts would show up under "KDE Daemon" rather than "Media Controller" or Audio Volume". I wonder if there's a way to have the best of both worlds... >the shortcuts would show up under "KDE Daemon"
That's a non-issue. Any component name can be set.
Downside is the fact that now we have to load and track everything twice, especially if it's in kded. There's an overhead cost.
*** Bug 416841 has been marked as a duplicate of this bug. *** (In reply to Nate Graham from comment #14) > *** Bug 416841 has been marked as a duplicate of this bug. *** It seems like the hypothesis of this bug only occurring when there's no widget at all is not correct, or that the bug I opened (and which Nate closed) is not related to this one. In my case, I always use the widget on my panel (not in the tray). So there is in fact a widget which could register the keys, but it doesn't work. I would therefore say that the issue is not about the key presses not being registered when there's no tray applet or widget, at least as far as the bug I reported is concerned. *** Bug 395444 has been marked as a duplicate of this bug. *** *** Bug 460436 has been marked as a duplicate of this bug. *** *** Bug 460771 has been marked as a duplicate of this bug. *** Seems fixed with https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2895 |