xpra icon
Bug tracker and wiki

Opened 11 days ago

Closed 7 days ago

Last modified 7 days ago

#1904 closed defect (fixed)

xpra screenshots not working

Reported by: paul Owned by: paul
Priority: major Milestone: 2.4
Component: server Version: 2.3.x
Keywords: Cc:


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)")

  • I tried adding --sync-xvfb=50 which does not solve the issue
  • When I connect a session the screenshot works, this is not an option though as the xpra session is only used for debugging purposes.

Change History (5)

comment:1 Changed 11 days ago by Antoine Martin

Milestone: 2.4
Owner: changed from Antoine Martin to paul

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

comment:2 in reply to:  description Changed 10 days ago by paul

Owner: changed from paul to Antoine Martin

first test:

  • running: xpra start-desktop --resize-display=no --start="xrandr -s 1920x1080" --daemon=no --exit-with-children=yes --socket-dir=$HOME/.xpra --start-child="xterm" works
  • running: xpra start --resize-display=no --start="xrandr -s 1920x1080" --daemon=no --exit-with-children=yes --socket-dir=$HOME/.xpra --start-child="xterm" does not work

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:

  • debian 9 (stretch)
  • xpra: v2.3.1-r19531
  • running in docker
  • X.Org X Server 1.19.2

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.
Last edited 10 days ago by Antoine Martin (previous) (diff)

comment:3 Changed 9 days ago by Antoine Martin

Owner: changed from Antoine Martin to paul

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
$ 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.

Last edited 7 days ago by Antoine Martin (previous) (diff)

comment:4 Changed 7 days ago by Antoine Martin

Resolution: fixed
Status: newclosed

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.

comment:5 Changed 7 days ago by 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

Note: See TracTickets for help on using tickets.