Newsgroups: comp.os.linux.x Date: 4 Apr 2003 02:36:07 GMT
> How to make a screenshot with the mouse pointer in it? I tried xwd, > gimp, ... None of the images they dumped have a mouse pointer in it.
This is, ironically, a feature. Modern X servers use modern videocards' "hardware cursor" functionality unless you specifically tell them not to. This means the cursor is kept in a special block of video memory and not the main framebuffer. This makes drawing the cursor and moving it around much faster than it would be otherwise. However, the XGetImage() call executed on the root window doesn't return the block of video memory that contains the cursor, just the main framebuffer.
Don't know what to say here… you might try fiddling with your /etc/X11/XF86Config file by going to the Device section and entering the line
Option "HWCursor" "off"
..and restarting X, then trying again. Except that doesn't work for. me. I don't know, the easiest thing to do is probably to paint the cursor in again using Gimp if you really need it. FWIW, I haven't been able to take a screenshot in Windows with the cursor in it either—only system where the cursor is always in screenshots that I've seen is MacOS before OS X.
Matt G
Another possibility is to use an X server that writes into a virtual frame buffer. Xvfb or Xvnc sping to mind. I'd try using Xvnc to serve the app involved, then use a vncviewer (being careful to turn off cursorshape if the viewer supports it), then grab the resulting screen image, which should have a cursor in it. Xvfb is more difficult to interact with, which is why I'd use Xvnc for this purpose.
Mind you: capture from the outer server, not the Xvnc directly; often things are set up so that XGetImage doesn't include the cursor, even when the server is writing on a virtual frame buffer.
Wayne Throop