Created attachment 14611 [details] [review]
The original code was not properly checking if a window
of different depth was offscreen, or had a dimension smaller
than the default 64x64, and this way causing X Errors due
to calling XGetImage with improper parameters.
Fixed in commit a3e1a9b4cb732b86b84375013e3fa531395b45cf.