After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 144788 - gimp acquire screenshot for partially obscured window, corrupt image
gimp acquire screenshot for partially obscured window, corrupt image
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.0.x
Other All
: Normal minor
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
: 335249 347431 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-06-21 23:52 UTC by Tim Mooney
Modified: 2006-07-14 07:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tim Mooney 2004-06-21 23:52:23 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).
Comment 1 weskaggs 2004-06-22 00:59:11 UTC
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.
Comment 2 Simon Budig 2004-06-22 01:34:01 UTC
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).
Comment 3 Tim Mooney 2004-06-22 04:09:22 UTC
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.
Comment 4 weskaggs 2004-06-22 14:29:21 UTC
I meant that there is no need for you to send screenshots to Bugzilla -- sorry
for obscurity.
Comment 5 Tim Mooney 2004-06-22 16:15:34 UTC
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.
Comment 6 Sven Neumann 2004-06-22 16:30:25 UTC
You can continue to use xwd (which is what the old screenshot plug-in was
using). GIMP still loads the xwd file format.
Comment 7 Tim Mooney 2004-06-22 16:37:39 UTC
I will if needed -- just wanted to make sure people were aware of the issue.
Comment 9 Sven Neumann 2004-10-23 15:42:15 UTC
Your comment at the RedHat bugtracker misses the third solution:

- Use xwd to take the screenshot and load the resulting image into GIMP.
Comment 10 weskaggs 2005-03-22 20:11:23 UTC
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.
Comment 11 Sven Neumann 2006-03-21 19:31:21 UTC
*** Bug 335249 has been marked as a duplicate of this bug. ***
Comment 12 Sven Neumann 2006-07-14 07:42:07 UTC
*** Bug 347431 has been marked as a duplicate of this bug. ***