Bug 483869 - KWin DBus API cannot be found even though kwin_wayland is being used
Summary: KWin DBus API cannot be found even though kwin_wayland is being used
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 24.02.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-17 22:35 UTC by AF
Modified: 2024-05-26 22:37 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 24.05.0


Attachments
stack trace (18.55 KB, text/plain)
2024-03-17 22:35 UTC, AF
Details

Note You need to log in before you can comment on or make changes to this bug.
Description AF 2024-03-17 22:35:31 UTC
Created attachment 167391 [details]
stack trace

SUMMARY
When I click the launcher for spectacle, nothing happens. If I try to launch Spectacle from within Konsole, it just immediately returns:

[s@desktop1 ~]$ spectacle
[s@desktop1 ~]$ 

I tried to generate a back trace, but gdb ends with "No stack." I attached a copy of what I am seeing to this bug report.

I am able to reproduce this issue on two systems with extremely different hardware:

1. AMD CPU, nvidia GPU, X11
2. Intel CPU, Intel iGPU, Wayland

Let me know if any more information is required.

STEPS TO REPRODUCE
1. Try to launch Spectacle.

OBSERVED RESULT
Nothing happens.

EXPECTED RESULT
Spectacle should open.

SOFTWARE/OS VERSIONS
*** System 1 ***
Operating System: Arch Linux 
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.8.1-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 5800X3D 8-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 2070 SUPER/PCIe/SSE2
Manufacturer: ASUS

*** System 2 ***
Operating System: Arch Linux
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.8.1-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 6 × Intel® Core™ i5-8500 CPU @ 3.00GHz
Memory: 31.0 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 630
Manufacturer: Dell Inc.
Product Name: OptiPlex 5060



ADDITIONAL INFORMATION
Comment 1 Nate Graham 2024-04-10 18:02:23 UTC
Is it secretly already running in the background, and preventing a new instance from launching?
Comment 2 AF 2024-04-10 18:27:03 UTC
Starting from a fresh KDE session, I check if spectacle is running:

> ps aux | grep -i spectacle | grep -v grep

I get no results. If I then launch spectacle, the same behavior as described in OP occurs, If I then check if spectacle is running again with ps aux, I do see that it is running but there is nothing visible in the UI.
Comment 3 AF 2024-04-10 20:32:14 UTC
Strangely enough, I was just playing around with this some more on another system to see if I could find anything. The specs of that system:

Operating System: Arch Linux 
KDE Plasma Version: 6.0.3
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.3
Kernel Version: 6.8.4-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × 12th Gen Intel® Core™ i5-12600K
Memory: 31.2 GiB of RAM
Graphics Processor: Mesa Intel® Arc
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B760M C
System Version: -CF

This time when I went to launch Spectacle from Konsole, I got some logging information:

> /usr/bin/spectacle
Remember requesting the interface on your desktop file: X-KDE-Wayland-Interfaces=zkde_screencast_unstable_v1
kpipewire_record_logging: VAAPI: Display initialized
kpipewire_record_logging: VAAPI: API version 1 . 21
kpipewire_record_logging: VAAPI: Intel iHD driver for Intel(R) Gen Graphics - 24.2.0 () in use for device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: entrypoint 6 of profile 13 is not supported by the device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: Display initialized
kpipewire_record_logging: VAAPI: API version 1 . 21
kpipewire_record_logging: VAAPI: Intel iHD driver for Intel(R) Gen Graphics - 24.2.0 () in use for device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: profile 14 is not supported by the device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: profile 14 is not supported by the device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: Display initialized
kpipewire_record_logging: VAAPI: API version 1 . 21
kpipewire_record_logging: VAAPI: Intel iHD driver for Intel(R) Gen Graphics - 24.2.0 () in use for device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: entrypoint 6 of profile 6 is not supported by the device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: Display initialized
kpipewire_record_logging: VAAPI: API version 1 . 21
kpipewire_record_logging: VAAPI: Intel iHD driver for Intel(R) Gen Graphics - 24.2.0 () in use for device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: entrypoint 6 of profile 13 is not supported by the device "/dev/dri/renderD128"
Screenshot request failed: "The process is not authorized to take a screenshot"
qt.qml.typeresolution.cycle: Cyclic dependency detected between "qrc:/qt/qml/org/kde/desktop/private/TextFieldContextMenu.qml" and "qrc:/qt/qml/org/kde/desktop/MenuItem.qml"

I then tried repeating the exact same action. For some reason, now Spectacle does actually launch, but I different output:

> /usr/bin/spectacle
On Wayland, Spectacle requires KDE Plasma's KWin compositor, which does not seem to be available. Use Spectacle on KDE Plasma, or use a different screenshot tool.
Remember requesting the interface on your desktop file: X-KDE-Wayland-Interfaces=zkde_screencast_unstable_v1
kpipewire_record_logging: VAAPI: Display initialized
kpipewire_record_logging: VAAPI: API version 1 . 21
kpipewire_record_logging: VAAPI: Intel iHD driver for Intel(R) Gen Graphics - 24.2.0 () in use for device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: entrypoint 6 of profile 13 is not supported by the device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: Display initialized
kpipewire_record_logging: VAAPI: API version 1 . 21
kpipewire_record_logging: VAAPI: Intel iHD driver for Intel(R) Gen Graphics - 24.2.0 () in use for device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: profile 14 is not supported by the device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: profile 14 is not supported by the device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: Display initialized
kpipewire_record_logging: VAAPI: API version 1 . 21
kpipewire_record_logging: VAAPI: Intel iHD driver for Intel(R) Gen Graphics - 24.2.0 () in use for device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: entrypoint 6 of profile 6 is not supported by the device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: Display initialized
kpipewire_record_logging: VAAPI: API version 1 . 21
kpipewire_record_logging: VAAPI: Intel iHD driver for Intel(R) Gen Graphics - 24.2.0 () in use for device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: entrypoint 6 of profile 13 is not supported by the device "/dev/dri/renderD128"
Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name org.kde.kglobalaccel was not provided by any .service files")
kf.windowsystem: static bool KX11Extras::compositingActive() may only be used on X11
qt.qml.typeresolution.cycle: Cyclic dependency detected between "qrc:/qt/qml/org/kde/desktop/private/TextFieldContextMenu.qml" and "qrc:/qt/qml/org/kde/desktop/MenuItem.qml"

I am unable to actually take any screenshots with it, but the application is open. AFAIK kwin is running normally, I have never tried to use any other compositor.

> ps aux | grep -i kwin | grep -v grep
s           1071  0.0  0.0 147760 16092 ?        Ssl  11:37   0:00 /usr/bin/kwin_wayland_wrapper --xwayland
s           1074  4.5  0.6 3262600 227616 ?      Sl   11:37   7:51 /usr/bin/kwin_wayland --wayland-fd 7 --socket wayland-0 --xwayland-fd 8 --xwayland-fd 9 --xwayland-display :1 --xwayland-xauthority /run/user/1000/xauth_nOWgfe --xwayland
Comment 4 Noah Davis 2024-04-10 20:50:43 UTC
So the issue is that for whatever reason, spectacle doesn't have the ability to use KWin's screenshot plugin on your machine
Comment 5 Noah Davis 2024-04-10 21:00:03 UTC
What is the output of `qdbus6 org.kde.KWin /Effects org.kde.kwin.Effects.isEffectLoaded screenshot`? It should be true.
What is the output of `qdbus6 org.kde.KWin.ScreenShot2 /org/kde/KWin/ScreenShot2 org.kde.KWin.ScreenShot2.Version`? It should be 4.
Comment 6 AF 2024-04-10 21:01:55 UTC
> qdbus6 org.kde.KWin /Effects org.kde.kwin.Effects.isEffectLoaded screenshot
Cannot find 'org.kde.kwin.Effects.isEffectLoaded' in object /Effects at org.kde.KWin

> qdbus6 org.kde.KWin.ScreenShot2 /org/kde/KWin/ScreenShot2 org.kde.KWin.ScreenShot2.Version
Service 'org.kde.KWin.ScreenShot2' does not exist.
Comment 7 Noah Davis 2024-04-10 21:26:40 UTC
What is the output of `qdbus6 --literal org.kde.KWin /Effects Introspect`?

If that fails, what is the output of `qdbus6 --literal org.kde.KWin / Introspect`?
Comment 8 AF 2024-04-10 21:35:01 UTC
> qdbus6 --literal org.kde.KWin /Effects Introspect
Service 'org.kde.KWin' does not exist.

> qdbus6 --literal org.kde.KWin / Introspect
Service 'org.kde.KWin' does not exist.
Comment 9 Nate Graham 2024-04-10 21:42:20 UTC
Are you not using KWin?
Comment 10 AF 2024-04-10 21:47:02 UTC
I am AFAIK, I installed KDE Plasma on all of my systems according to the instructions on the Arch Wiki. All of my systems were installed during the Plasma 5 times and were upgraded to 6. I have never attempted to install or use a different compositor, and I use SDDM.

> ps aux | grep -i kwin | grep -v grep
s           1071  0.0  0.0 147760 16092 ?        Ssl  11:37   0:00 /usr/bin/kwin_wayland_wrapper --xwayland
s           1074  4.6  0.7 3256544 235176 ?      Sl   11:37  11:24 /usr/bin/kwin_wayland --wayland-fd 7 --socket wayland-0 --xwayland-fd 8 --xwayland-fd 9 --xwayland-display :1 --xwayland-xauthority /run/user/1000/xauth_nOWgfe --xwayland
Comment 11 Noah Davis 2024-04-10 22:32:21 UTC
When you want to mark a report as no longer needing info, it's better to set it as REPORTED instead of NEEDSINFO FIXED
Comment 12 AF 2024-04-10 22:37:48 UTC
It seems I did that by accident, my apologies.
Comment 13 Noah Davis 2024-04-10 22:41:11 UTC
I've got no idea why /usr/bin/spectacle would be unable to access the DBus API of /usr/bin/kwin_wayland. Even more so, why qdbus would be unable to find KWin's DBus API. Perhaps there's a system configuration issue of some kind? Maybe a KWin dev would have an idea? Moving this report to KWin for now.
Comment 14 David Edmundson 2024-04-16 16:33:55 UTC
can you run 

ps ux | grep dbus

when in this state
Comment 15 AF 2024-04-16 19:09:40 UTC
Strangely I am no longer able to reproduce the kwin issues, but my original Spectacle issue still exists. Perhaps the recent batch of KDE updates fixed it?

`qdbus6 org.kde.KWin /Effects org.kde.kwin.Effects.isEffectLoaded screenshot`

returns true

`qdbus6 org.kde.KWin.ScreenShot2 /org/kde/KWin/ScreenShot2 org.kde.KWin.ScreenShot2.Version`

returns 4

`qdbus6 --literal org.kde.KWin /Effects Introspect`

returns:

"<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
  <interface name="org.kde.kwin.Effects">
    <property access="read" type="as" name="activeEffects"/>
    <property access="read" type="as" name="loadedEffects"/>
    <property access="read" type="as" name="listOfEffects"/>
    <method name="reconfigureEffect">
      <arg direction="in" type="s" name="name"/>
    </method>
    <method name="loadEffect">
      <arg direction="out" type="b"/>
      <arg direction="in" type="s" name="name"/>
    </method>
    <method name="toggleEffect">
      <arg direction="in" type="s" name="name"/>
    </method>
    <method name="unloadEffect">
      <arg direction="in" type="s" name="name"/>
    </method>
    <method name="isEffectLoaded">
      <arg direction="out" type="b"/>
      <arg direction="in" type="s" name="name"/>
    </method>
    <method name="isEffectSupported">
      <arg direction="out" type="b"/>
      <arg direction="in" type="s" name="name"/>
    </method>
    <method name="areEffectsSupported">
      <arg direction="out" type="ab"/>
      <annotation value="QList&lt;bool&gt;" name="org.qtproject.QtDBus.QtTypeName.Out0"/>
      <arg direction="in" type="as" name="names"/>
    </method>
    <method name="supportInformation">
      <arg direction="out" type="s"/>
      <arg direction="in" type="s" name="name"/>
    </method>
    <method name="debug">
      <arg direction="out" type="s"/>
      <arg direction="in" type="s" name="name"/>
      <arg direction="in" type="s" name="name"/>
    </method>
  </interface>
  <interface name="org.freedesktop.DBus.Properties">
    <method name="Get">
      <arg name="interface_name" type="s" direction="in"/>
      <arg name="property_name" type="s" direction="in"/>
      <arg name="value" type="v" direction="out"/>
    </method>
    <method name="Set">
      <arg name="interface_name" type="s" direction="in"/>
      <arg name="property_name" type="s" direction="in"/>
      <arg name="value" type="v" direction="in"/>
    </method>
    <method name="GetAll">
      <arg name="interface_name" type="s" direction="in"/>
      <arg name="values" type="a{sv}" direction="out"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
    </method>
    <signal name="PropertiesChanged">
      <arg name="interface_name" type="s" direction="out"/>
      <arg name="changed_properties" type="a{sv}" direction="out"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
      <arg name="invalidated_properties" type="as" direction="out"/>
    </signal>
  </interface>
  <interface name="org.freedesktop.DBus.Introspectable">
    <method name="Introspect">
      <arg name="xml_data" type="s" direction="out"/>
    </method>
  </interface>
  <interface name="org.freedesktop.DBus.Peer">
    <method name="Ping"/>
    <method name="GetMachineId">
      <arg name="machine_uuid" type="s" direction="out"/>
    </method>
  </interface>
</node>
"

`qdbus6 --literal org.kde.KWin / Introspect`

returns:

"<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
  <interface name="org.freedesktop.DBus.Introspectable">
    <method name="Introspect">
      <arg name="xml_data" type="s" direction="out"/>
    </method>
  </interface>
  <interface name="org.freedesktop.DBus.Peer">
    <method name="Ping"/>
    <method name="GetMachineId">
      <arg name="machine_uuid" type="s" direction="out"/>
    </method>
  </interface>
  <node name="ColorPicker"/>
  <node name="Compositor"/>
  <node name="Effects"/>
  <node name="FTrace"/>
  <node name="KWin"/>
  <node name="Layouts"/>
  <node name="Plugins"/>
  <node name="ScreenSaver"/>
  <node name="Scripting"/>
  <node name="Session"/>
  <node name="VirtualDesktopManager"/>
  <node name="VirtualKeyboard"/>
  <node name="WindowsRunner"/>
  <node name="component"/>
  <node name="kglobalaccel"/>
  <node name="org"/>
</node>
"

`/usr/bin/spectacle`

Still has the same results:

Remember requesting the interface on your desktop file: X-KDE-Wayland-Interfaces=zkde_screencast_unstable_v1
kpipewire_record_logging: VAAPI: Display initialized
kpipewire_record_logging: VAAPI: API version 1 . 21
kpipewire_record_logging: VAAPI: Intel iHD driver for Intel(R) Gen Graphics - 24.2.0 () in use for device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: entrypoint 6 of profile 13 is not supported by the device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: Display initialized
kpipewire_record_logging: VAAPI: API version 1 . 21
kpipewire_record_logging: VAAPI: Intel iHD driver for Intel(R) Gen Graphics - 24.2.0 () in use for device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: profile 14 is not supported by the device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: profile 14 is not supported by the device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: Display initialized
kpipewire_record_logging: VAAPI: API version 1 . 21
kpipewire_record_logging: VAAPI: Intel iHD driver for Intel(R) Gen Graphics - 24.2.0 () in use for device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: entrypoint 6 of profile 6 is not supported by the device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: Display initialized
kpipewire_record_logging: VAAPI: API version 1 . 21
kpipewire_record_logging: VAAPI: Intel iHD driver for Intel(R) Gen Graphics - 24.2.0 () in use for device "/dev/dri/renderD128"
kpipewire_record_logging: VAAPI: entrypoint 6 of profile 13 is not supported by the device "/dev/dri/renderD128"
Screenshot request failed: "The process is not authorized to take a screenshot"
Comment 16 AF 2024-05-26 22:36:18 UTC
After the latest KDE & KDE Frameworks updates, I finally have some progress!

Operating System: Arch Linux
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1
Kernel Version: 6.9.2-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × 12th Gen Intel® Core™ i5-12600K
Memory: 31.2 GiB of RAM
Graphics Processor: Mesa Intel® Arc
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B760M C
System Version: -CF

Prior to today's updates to KDE on Arch, Spectacle wouldn't open since the update to Plasma 6. Now when I launch Spectacle the application actually opens and I got the following error:

An error occurred while taking a screenshot.
KWin screenshot request failed:
The process is not authorized to take a screenshot
Potentially relevant information:
- Method: CaptureScreen
- Method specific arguments: "DP-3"
KWin screenshot request failed:
The process is not authorized to take a screenshot
Potentially relevant information:
- Method: CaptureScreen
- Method specific arguments: "HDMI-A-3"
KWin screenshot request failed:
The process is not authorized to take a screenshot
Potentially relevant information:
- Method: CaptureScreen
- Method specific arguments: "HDMI-A-2"
KWin screenshot request failed:
The process is not authorized to take a screenshot
Potentially relevant information:
- Method: CaptureScreen
- Method specific arguments: "HDMI-A-1"

I did some googling and found this bug: https://bugs.kde.org/show_bug.cgi?id=446628 

There were references to deleting ~/.local/share/applications/org.kde.spectacle.desktop can resolve this issue. After deleting that file, which did exist on my system, and rebooting, I can FINALLY use spectacle again! Not sure what my issue ever actually was or what fixed it, but it seems that the latest updates got everything worked out on my system.