XWindows - how capture window ?

XWindows - how capture window ?

Valery Reznic valery_reznic at yahoo.com
Sat Feb 20 22:13:07 IST 2010


Hi all.

I faced following problem:
I have X-Windows application. It has a lot of different functions and buttons.

When one of those buttons is pressed applications open a window
This window has a lot of different widgets inside (labels, pixmaps, buttons, etc)

I need to capture this windows and save it content to the file.
It's not that hard - xgrabsc program do all the work.

But what is hard (at least hard for me :) is to capture content of this window, without it appearing on the screen.

I have source of this application, and can change it as I like.
The trouble is unless windows actually appears on the screen, xserver don't bother to draw it.

My screen is 640x480 I tried to create window with offset 641 and 481 - i.e off screen. It doesn't work. I.e window created and grabbed by xgrabsc, but it's content is garbage.
When offse is 400and 400 then part of the window appears on the screen and part not.
After grabbing this window I saw, that part that appears on screen looks OK, but other part is garbage.

I also tried to use XComoposite extension - without any success.

Application is very, very ancient. It was written withusing Xlib functions and Xt toolkit - hardly more.

Also application uses XSHM extension, i.e solution don't have be "network-aware" - anyway this application doomed to work only locally by this extension.

I by no mean X expert, may be I missed something obvious with XComposite 
or just missed something

Do you have any ideas, how can I render this window off screen and capture it's content ?

Valery.


      



More information about the Linux-il mailing list