Use dbus-send instead of qdbus for global shortcuts
Needs RevisionPublic

Authored by ngraham on Wed, Nov 13, 5:43 PM.

Details

Reviewers
davidedmundson
fvogt
davidre
Group Reviewers
Spectacle
Summary

On some distros, qdbus is called qdbus-qt5 and there isn't a compatibility symlink,
so we can't rely on the command always having the same name. We should instead use a
command whose name is always the same.

BUG: 413007
FIXED-IN: 20.04.0

Test Plan

Install to /usr, overriding system stuff

Hit print screen button

Diff Detail

Repository
R166 Spectacle
Branch
dbus-send (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 18762
Build 18780: arc lint + arc unit
ngraham created this revision.Wed, Nov 13, 5:43 PM
Restricted Application added a project: Spectacle. · View Herald TranscriptWed, Nov 13, 5:43 PM
ngraham requested review of this revision.Wed, Nov 13, 5:43 PM
ngraham retitled this revision from [RFC] Use dbus-send instead of qtdbus for global shortcuts to Use dbus-send instead of qdbus for global shortcuts.Wed, Nov 13, 9:00 PM
ngraham edited the summary of this revision. (Show Details)
ngraham edited the test plan for this revision. (Show Details)

Shortcuts work for me. For testing make sure to install to /usr since we link our .desktop from KDE_INSTALL_FULL_APPDIR to the kglobalaccel one.

davidre accepted this revision.Wed, Nov 13, 9:19 PM
This revision is now accepted and ready to land.Wed, Nov 13, 9:19 PM

Shortcuts work for me. For testing make sure to install to /usr

For some reason this does not actually make it work for me. But you can confirm that it works for you?

fvogt added a comment.Thu, Nov 14, 7:59 AM

It doesn't seem to work here either, but adding the --print-reply argument helps for some reason.

davidre added a comment.EditedThu, Nov 14, 8:07 AM

Sorry, it doesn't work for me either. I didn't relog before testing and I guess it was still using the qdbus commands. KLauncher gets the right arguments I think:

davidre requested changes to this revision.Thu, Nov 14, 8:07 AM
This revision now requires changes to proceed.Thu, Nov 14, 8:07 AM

Sorry, it doesn't work for me either. I didn't relog before testing and I guess it was still using the qdbus commands. KLauncher gets the right arguments I think:

What does this mean? Sorry, I'm pretty new to dbus.

Sorry, it doesn't work for me either. I didn't relog before testing and I guess it was still using the qdbus commands. KLauncher gets the right arguments I think:

What does this mean? Sorry, I'm pretty new to dbus.

I don't know but KGlobalAccel uses KLauncher to execute the command found in the Exec line of the desktop file.
However I noticed something weird when manually using your dbus-send commands. dbus-send --session --dest='org.kde.Spectacle' --type=method_call '/' 'org.kde.Spectacle.StartAgent' only seemed to work every second time.

Yeah, now that you mention it, I notice that too.