GNOME Bugzilla – Bug 144788
gimp acquire screenshot for partially obscured window, corrupt image
Last modified: 2006-07-14 07:42:07 UTC
I opened gimp and several of its dialogs. Some of the dialogs partially-obscured an 80x58 xterm window. If I do File->Acquire->Screen Shot, and select that I want "the Whole Screen", the resulting image exactly matches what I see on screen. If I instead do File->Acquire->Screen Shot, and select that I want "a Single Window" and I select the xterm that's partially obscured by the gimp, I get an image that matches the size of the window, and the parts of it that are *not* obscured are correct, but the parts of the window that are obscured by the gimp dialog boxes are corrupt. I can provide the two screenshots if you want (let me know what format you prefer, I saved them as xwd files and they're big enough so I don't want to attach them to this report).
This is not a bug, or at least, not a GIMP bug. If the X Server does not have backing store for an obscured window (and there is nothing that requires it to), then the only way to make the contents known is to bring it to the front and wait for it to redraw itself. The screenshot utility is not intended to do this. It is up to the user to expose the window before shooting it. The "delay" parameter in the screenshot dialog gives you a way to do this in difficult situations. There is no need for screenshots -- X screen dump utilities have all worked this way since the beginning of time.
Actually most screenshot tools I know show the things that are obscuring the window, not some random garbage. I guess the trick is to always get the content from the root window (restricted to the area of the target window).
My experiences match Simon's. I've never had any other X tools, including xwd, give me garbage in the obscured area. I reported the issue because I was surprised by it, and thought it might be something that people are unaware of, not because I think it's a critical problem. I'm not sure what you mean by "no need for screenshots". Are you saying that the "Acquire->Screenshot" shouldn't be used? I'm not at work and can't easily check what xwininfo says about backing store for any of the windows. I'll add more info to this ticket tomorrow.
I meant that there is no need for you to send screenshots to Bugzilla -- sorry for obscurity.
Ah, I understand now. Thanks for clarifying! I checked the obscured xterm, and `xwininfo' reports that the "Backing Store State" is "NotUseful". I've been using X windows for close to 15 years, but I must admit my understanding of backing store is still pretty sketchy. You seem to be implying that "Backing Store" relates to saving the portion of a window that is obscured. I thought that was "Save Unders". It even took me a while to find good definitions using Google, but http://www.astro.princeton.edu/~esirko/idl_html_help/T34.html has a little blurb about backing store and a link to a longer definition here http://www.astro.princeton.edu/~esirko/idl_html_help/devices5.html#wp144260 In any case, the blurb in the first link pretty much confirms what weskaggs indicated -- without backing store, the obscured portion is essentially "undefined". However, all the tools I've ever used (including the lowly xwd) show the obscuring window, rather than random garbage. If one of the gimp developers knows how to fix this and it's easy, that's great, but otherwise lowering the priority or even changing this to an enhancement request would be appropriate. It's not a major problem, it was just a surprise, based on my experience with less capable tools.
You can continue to use xwd (which is what the old screenshot plug-in was using). GIMP still loads the xwd file format.
I will if needed -- just wanted to make sure people were aware of the issue.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=136889
Your comment at the RedHat bugtracker misses the third solution: - Use xwd to take the screenshot and load the resulting image into GIMP.
Okay, I changed the screenshot plug-in so that it always takes a picture of the root window, and only uses the selected window to figure out what portion to take a picture of. Note that this plug-in remains to be implemented for Windows -- this may just be a matter of writing code to get the identity of the window under the cursor. Probably not worth backporting to 2.2, so I will resolve as FIXED. 2005-03-22 Bill Skaggs <weskaggs@primate.ucdavis.edu> * plug-ins/common/screenshot.c: always derive image from root window, fixes bug #144788.
*** Bug 335249 has been marked as a duplicate of this bug. ***
*** Bug 347431 has been marked as a duplicate of this bug. ***