Use dbus-send instead of qdbus for global shortcuts
AbandonedPublic

Authored by ngraham on Nov 13 2019, 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.Nov 13 2019, 5:43 PM
Restricted Application added a project: Spectacle. · View Herald TranscriptNov 13 2019, 5:43 PM
ngraham requested review of this revision.Nov 13 2019, 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.Nov 13 2019, 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.Nov 13 2019, 9:19 PM
This revision is now accepted and ready to land.Nov 13 2019, 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.Nov 14 2019, 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.EditedNov 14 2019, 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.Nov 14 2019, 8:07 AM
This revision now requires changes to proceed.Nov 14 2019, 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.

ngraham abandoned this revision.Dec 11 2019, 12:53 PM

Found a better way that doesn't involve going insane trying to make dbus-send work: D25883