[MPRIS Data Engine] Only register global shortcuts when loaded in plasmashell
AbandonedPublic

Authored by broulik on Jun 4 2017, 9:49 PM.

Details

Reviewers
None
Group Reviewers
Plasma
Summary

Keeps the lock screen from stealing the shortcuts.

CHANGELOG: Fixed media keys not working after locking and unlocking the screen

BUG: 380526
FIXED-IN: 5.10.1

Test Plan

Don't have media keys on my laptop so I assigned Meta+P to pause, pressed it, locked screen, still works both on the lock screen and after unlocking.

Also keeps plasmoidviewer from stealing them when working on media controller applet

Diff Detail

Repository
R120 Plasma Workspace
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Jun 4 2017, 9:49 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJun 4 2017, 9:49 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

Heh, literally got a collision on bugzilla as I was looking into it at just the same time.

I reached the same conclusion on what the bug is. +1

That solution, and I don't think I need to tell you, is a hack.

We can do it for 5.10 so we have something in the .1 release, but I'm not happy with it as a final solution.

IMHO we should move the shortcut handling from the dataengine to something else which our MPRIS applet can load.
Dataengines should be read only data fetchers; not handling events; it goes against their own design.

If no-one does a better fix by the end of tomorrow (I have an idea in mind) go ahead and push this.

Zren added a subscriber: Zren.Jun 4 2017, 10:16 PM
Zren added a comment.Jun 5 2017, 1:14 AM

Hmm, just of this after reading a comment on reddit. Latte-Dock uses another process, would this cause keyboard shortcuts to not work for it? I'm not sure if it has a different app name.

https://github.com/psifidotos/Latte-Dock/blob/02f247d53fbf8fa2744704fb66c08dff1ced369b/app/main.cpp#L67
https://github.com/KDE/plasma-workspace/blob/fb30ea87e68407515f9be246426dc27ac2630934/shell/main.cpp#L55

I'm not certain what sets qApp->applicationName().

In D6095#114166, @Zren wrote:

Hmm, just of this after reading a comment on reddit. Latte-Dock uses another process, would this cause keyboard shortcuts to not work for it? I'm not sure if it has a different app name.

https://github.com/psifidotos/Latte-Dock/blob/02f247d53fbf8fa2744704fb66c08dff1ced369b/app/main.cpp#L67
https://github.com/KDE/plasma-workspace/blob/fb30ea87e68407515f9be246426dc27ac2630934/shell/main.cpp#L55

I'm not certain what sets qApp->applicationName().

no prob from Latte side... it is better for us to have that functionality disabled, we can fix afterwards some issues when combining plasma panels with latte docks

broulik abandoned this revision.Jun 5 2017, 12:12 PM

Superseded by D6100