Bug 485352

Summary: ScreenShot2 CaptureScreen DBus timeout on X11
Product: [Plasma] kwin Reporter: Christophe Marin <christophe>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: fabian, kde, nate, noahadvs, qydwhotmail, saraistupidd
Priority: NOR Keywords: regression
Version: git master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 6.0.5
Attachments: dbus-monitor

Description Christophe Marin 2024-04-10 23:58:21 UTC
Using master, Qt 6.7 and X11.

spectacle became unresponsive on X11, either when using the printscreen key or spectacle -g

# spectacle -g
1:53:28 - spectacle(10667) -  : Screenshot request failed: "Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken."

Bisecting reports the regression comes from commit 00c90e574ae93b146e703b8f5a7cb6db42fda465
Comment 1 Noah Davis 2024-04-15 20:43:23 UTC
Unfortunately, I cannot reproduce this.
Comment 2 Christophe Marin 2024-04-19 08:01:44 UTC
Do you have hints to get more useful debug info?
Comment 3 Christophe Marin 2024-04-19 09:20:39 UTC
- spectacle appears with 'spectacle -a' or 'spectacle -l'. Taking a screenshot of the active window / window under cursor then works. 'current screen' only works on one of the monitors but not the second / rectangular and all screens buttons fail

- 'spectacle -u' succeeds
Comment 4 Noah Davis 2024-04-19 10:05:19 UTC
(In reply to Christophe Marin from comment #2)
> Do you have hints to get more useful debug info?

Unfortunately no. I'm not that familiar with DBus, but the DBus related stuff hasn't changed in a while. Despite that, there seems to be an uptick in DBus related issues. Maybe it was caused by an update in some other piece of software that Spectacle makes use of?
Comment 5 Fabian Vogt 2024-04-19 11:50:18 UTC
FWICT with that commit spectacle sends a dbus call for every screen simultaneously and waits for the results. Apparently at least one of those requests does not get a reply. I suspect a bug in kwin, some error condition is probably not handled.

Please check dbus-monitor for the call that fails.
Comment 6 Christophe Marin 2024-04-19 12:23:59 UTC
Created attachment 168675 [details]
dbus-monitor

done
Comment 7 Christophe Marin 2024-04-19 12:25:53 UTC
spectacle stops responding after getting the resolution of the screen it's executed from (at line 1094 in the log)
Comment 8 Christophe Marin 2024-04-19 12:29:04 UTC
(In reply to Christophe Marin from comment #7)
> spectacle stops responding after getting the resolution of the screen it's

well, actually, the screen doesn't matter since the window doesn't appear
Comment 9 Fabian Vogt 2024-04-19 12:47:52 UTC
As expected, there is no reply to the second kwin CaptureScreen call:

method call time=1713529170.960644 sender=:1.307 -> destination=org.kde.KWin.ScreenShot2 serial=79 path=/org/kde/KWin/ScreenShot2; interface=org.kde.KWin.ScreenShot2; member=CaptureScreen
   string "DP-5"
   array [
      dict entry(
         string "include-decoration"
         variant             boolean true
      )
      dict entry(
         string "include-shadow"
         variant             boolean true
      )
      dict entry(
         string "native-resolution"
         variant             boolean true
      )
   ]
   file descriptor
         inode: 330426
         type: fifo
Comment 11 Noah Davis 2024-04-25 20:40:27 UTC
*** Bug 485959 has been marked as a duplicate of this bug. ***
Comment 12 Noah Davis 2024-05-17 14:24:47 UTC
*** Bug 486805 has been marked as a duplicate of this bug. ***