Xpra: Ticket #1904: xpra screenshots not working

I tried taking screenshots with both xpra screenshot and imagemagick, both fail (black screen with imagemagick, xpra: "screenshot: window 1 could not be captured screenshot is empty and has not been saved (maybe there are no windows or they are not currently shown)")



Fri, 06 Jul 2018 01:48:15 GMT - Antoine Martin: owner changed; milestone set

Please specify your full command lines, OS, version, etc.. as per wiki/ReportingBugs. Does it work with a plain xterm? screenshot works fine here.


Fri, 06 Jul 2018 11:44:08 GMT - paul: owner changed

first test:

I switched to start as start-desktop was error when the child exited.

I got some weird output from the tool, so my manual info:

When I run start-desktop, then exit the child, the xpra server terminates as expected, but with exit code 1, and an error:

2018-07-06 11:42:32,584 child 'xterm' with pid 1166 has terminated
2018-07-06 11:42:32,584 all children have exited and --exit-with-children was specified, exiting
2018-07-06 11:42:32,585 Disconnecting client Protocol(unix-domain socket:/home/chrome/.xpra/85d3f5123030-0):
2018-07-06 11:42:32,586  server shutdown
2018-07-06 11:42:32,591 xpra client 1 disconnected.
2018-07-06 11:42:32,592 sound source stopping
2018-07-06 11:42:33,102 killing xvfb with pid 1107
2018-07-06 11:42:33,102 removing socket /home/chrome/.xpra/85d3f5123030-0
(II) Server terminated successfully (0). Closing log file.
Xpra: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.

Sun, 08 Jul 2018 08:10:00 GMT - Antoine Martin: owner changed

I switched to start as start-desktop was error when the child exited. (..) When I run start-desktop, then exit the child, the xpra server terminates as expected, but with exit code 1, and an error:

This is fixed in r19872 + r19873 + r19875 and will be included in 2.3.3 In the meantime you can use those builds https://xpra.org/beta.

"xpra screenshot" works fine for me with "start-desktop".

As for "start" mode, the windows are not mapped on the virtual screen unless they are also mapped on one of the client(s) if one is connected. sync-xvfb does not change that, it only paints the virtual xvfb so that other tools can be used to take screenshots. (imagemagick, scrot, etc)


r19877 makes it possible to force the server to show all the windows even when no clients are connected, but you have to use dbus to call it and this requires finding out the dbus session address:

$ xpra start --start-child=xterm --exit-with-children :100
(..)
$ xpra info :100 | grep DBUS_SESSION_BUS_ADDRESS
env.DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-Ktrg2L9DAk,guid=32fea6050ebf2535f534a7515b41c5bb
$ DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-Ktrg2L9DAk,guid=32fea6050ebf2535f534a7515b41c5bb \
    qdbus --session --type=method_call org.xpra.Server100 /org/xpra/Server org.xpra.Server.ShowAllWindows
$ xpra screenshot test.png :100
$ eog test.png

Please close if that works for you. Feel free to create a new ticket to make the "ShowAllWindows" call more user friendly, an "xpra control" command would do the job.


Mon, 09 Jul 2018 15:49:06 GMT - Antoine Martin: status changed; resolution set

r19899 makes it easier to show all the windows, ie for DISPLAY=:100:

xpra control :100 show-all-windows
xpra screenshot :100 test.png

I'm closing as fixed because things are working as intended and you have a way to make sure that the windows are visible for the screenshot.

There are beta build for stretch with these changes here: https://xpra.org/beta/.

Feel free to re-open if I've missed something.


Mon, 09 Jul 2018 16:20:12 GMT - paul:

I think it would be good to have these screenshot quirks somewhere documented? I can't find it anywhere. I will open a ticket for the other bugs I spoke about in this ticket


Sat, 23 Jan 2021 05:36:53 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1904