Aha, this seems to be a more sensible way of getting screenshots:

instead of having the puzzle binary export its window ID to a script
which then runs xwd, we can use the gdk-pixbuf library to have the
puzzle binary _itself_ read its own internal pixmap and save it
straight to a PNG. How handy. And faster, and less timing-sensitive.

[originally from svn r7022]
This commit is contained in:
Simon Tatham
2006-12-27 15:21:55 +00:00
parent 61b983ae3a
commit 197c2ebc12
2 changed files with 24 additions and 20 deletions

View File

@ -22,13 +22,4 @@ else
redo=
fi
"$binary" $redo --windowid --load "$save" 2>/dev/null | {
read windowid
# I'm not sure why I have to do this sleep, since gtk.c does
# carefully redraw the window _before_ outputting the window ID,
# but nonetheless this script doesn't seem to be reliable without
# it :-/
sleep 1
xwd -silent -id $windowid | convert xwd:- "$image"
xkill -id $windowid >/dev/null
}
"$binary" $redo --screenshot "$image" --load "$save"