Bug 429634 - Spectacle starts but its main window doesn't show up after hitting Print shortcut key
Summary: Spectacle starts but its main window doesn't show up after hitting Print shor...
Status: RESOLVED NOT A BUG
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 20.08.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-25 11:19 UTC by Frederick Zhang
Modified: 2020-12-15 11:38 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
org.kde.spectacle.desktop in my home folder (1.36 KB, application/x-desktop)
2020-12-15 11:30 UTC, Frederick Zhang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frederick Zhang 2020-11-25 11:19:52 UTC
SUMMARY
Spectacle starts but its main window doesn't show up after hitting Print.

STEPS TO REPRODUCE
1. Make sure default Spectacle shortcut Print hasn't been changed
2. Press Print key

OBSERVED RESULT
From logs:
Nov 25 22:09:49 FredArch dbus-daemon[2886]: [session uid=1000 pid=2886] Activating service name='org.kde.Spectacle' requested by ':1.10349' (uid=1000 pid=271301 comm="qdbus org.kde.Spectacle / StartAgent ")
Nov 25 22:09:49 FredArch dbus-daemon[2886]: [session uid=1000 pid=2886] Successfully activated service 'org.kde.Spectacle'

From `ps aux`:
/usr/bin/spectacle --dbus

If I run `qdbus org.kde.Spectacle '/' StartAgent` in terminal:
Error: org.freedesktop.DBus.Error.UnknownMethod
No such method 'StartAgent' in any interface at object path '/' (signature '')


EXPECTED RESULT
Spectacle main window shows up after Print key is pressed.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.20.3
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.2
Kernel Version: 5.4.79-1-lts
OS Type: 64-bit
Comment 1 Nate Graham 2020-12-01 18:12:30 UTC
huh
Comment 2 Méven Car 2020-12-10 15:27:14 UTC
Does it work from terminal ?

What does return 
ls -l /usr/share/dbus-1/services/org.kde.Spectacle.service /usr/share/dbus-1/services/org.kde.Spectacle.service , and their content ?
Comment 3 Frederick Zhang 2020-12-13 11:45:18 UTC
> Does it work from terminal?

> qdbus org.kde.Spectacle '/' StartAgent

As mentioned in issue description.

> spectacle

Yes.

> ls -l /usr/share/dbus-1/services/org.kde.Spectacle.service /usr/share/dbus-1/services/org.kde.Spectacle.service

$ ls -l /usr/share/dbus-1/services/org.kde.Spectacle.service /usr/share/dbus-1/services/org.kde.Spectacle.service
-rw-r--r-- 1 root root 115 Dec  7 08:51 /usr/share/dbus-1/services/org.kde.Spectacle.service
-rw-r--r-- 1 root root 115 Dec  7 08:51 /usr/share/dbus-1/services/org.kde.Spectacle.service
$ cat /usr/lib/systemd/user/app-org.kde.spectacle.service
[Unit]
Description=Spectacle screenshot capture utility

[Service]
ExecStart=/usr/bin/spectacle --dbus
BusName=org.kde.Spectacle
$ pkgfile app-org.kde.spectacle.service
extra/spectacle
$ paru -Ql spectacle | rg app-org
spectacle /usr/lib/systemd/user/app-org.kde.spectacle.service
$ cat /usr/lib/systemd/user/app-org.kde.spectacle.service
[Unit]
Description=Spectacle screenshot capture utility

[Service]
ExecStart=/usr/bin/spectacle --dbus
BusName=org.kde.Spectacle
Comment 4 Méven Car 2020-12-14 18:42:42 UTC
It seems you have the "/usr/share/kglobalaccel/org.kde.spectacle.desktop".

The mystery is why `qdbus org.kde.Spectacle '/' StartAgent` would fail.
Error: org.freedesktop.DBus.Error.UnknownMethod
No such method 'StartAgent' in any interface at object path '/' (signature '')

It seems spectacle daemon, `/usr/bin/spectacle --dbus` is not started correctly, or in a bad state.

Have you tried kill the daemon "killall spectacle" and retrying ? Does it change anything ?

Does it happen all the time or only after a certain time after being logging-in ?
Comment 5 Frederick Zhang 2020-12-15 11:29:45 UTC
Ah, I noticed that I've got a bunch of .desktop files in my home folder:

$ ls -lah ~/.local/share/kglobalaccel
total 53K
drwxr-xr-x  2 frederick frederick   10 Aug 25  2019 .
drwxr-xr-x 88 frederick frederick   94 Dec 14 19:01 ..
-rw-------  1 frederick frederick  810 Jul  2  2019 firefox-developer-edition.desktop
-rw-------  1 frederick frederick  353 Apr 29  2017 org.kde.dolphin.desktop
-rw-------  1 frederick frederick  355 May 21  2018 org.kde.kcalc.desktop
-rw-------  1 frederick frederick  473 Apr 29  2017 org.kde.konsole.desktop
-rw-------  1 frederick frederick  502 Feb  6  2018 org.kde.ksysguard.desktop
-rw-------  1 frederick frederick 1.4K Aug 25  2019 org.kde.spectacle.desktop
-rw-------  1 frederick frederick  462 May 18  2018 systemsettings.desktop
-rw-------  1 frederick frederick  284 May 21  2018 telegramdesktop.desktop

The issue is gone after I removed these files. I don't remember creating them though... I'll upload the org.kde.spectacle.desktop file in case you are interested.
Comment 6 Frederick Zhang 2020-12-15 11:30:14 UTC
Created attachment 134087 [details]
org.kde.spectacle.desktop in my home folder
Comment 7 Méven Car 2020-12-15 11:38:07 UTC
Given how old org.kde.spectacle.desktop was in ~/.local/share/kglobalaccel the problem was that it was out-of-sync, spectacle dbus launching logic and org.kde.spectacle.desktop changed since.

Something we (devs) should be warry of.

IIRC files in ~/.local/share/kglobalaccel are used to set custom shortcuts, so FYI you may have lost them.

Thanks on you finding the culprit. Glad to have help.