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 121492 - screenshooting window with other windows overlapping produces strange effects
screenshooting window with other windows overlapping produces strange effects
Status: RESOLVED FIXED
Product: gnome-utils
Classification: Deprecated
Component: screenshot
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jonathan Blandford
gnome-utils Maintainers
: 160744 165949 332664 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-09-04 21:36 UTC by Dan Winship
Modified: 2007-03-08 14:19 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
3 screenshots (62.84 KB, image/png)
2005-07-11 16:02 UTC, Michaël Arnauts
  Details
Makes it so the screenshot isn't garbled when the active window isn't at the top (3.22 KB, patch)
2005-09-30 16:25 UTC, Björn Lindqvist
none Details | Review
Shows the patch's behaviour (25.05 KB, image/png)
2005-09-30 16:26 UTC, Björn Lindqvist
  Details
GNOME 2.14 backport (2.38 KB, patch)
2007-03-08 14:19 UTC, Loïc Minier
none Details | Review

Description Dan Winship 2003-09-04 21:36:49 UTC
If you try to take a screenshot of a window that has other windows
overlapping it, you get something weird. Basically, it seems to put
random screen junk in the part of the window that the other window
is overlapping.
Comment 1 Kjartan Maraas 2003-10-24 09:55:20 UTC
Moving
Comment 2 Christian Neumair 2004-10-21 19:13:41 UTC
Thanks for your bug report. I tried to reproduce this issue on GNOME 2.8 and for
me, gnome-panel-screenshot raised the current window before taking the
screenshot, so it seems to be fixed.
Feel free to complain if there is a condition where the window is not raised and
you get garbage output.
Comment 3 Vincent Untz 2004-11-06 08:23:27 UTC
If I take a screenshot of a window with an overlapping always on top window, I
can see this too.
Comment 4 Jonathan Blandford 2004-11-10 08:24:46 UTC
We need an X server with composite to get this working.  I'll probably add
support for this this release cycle.
Comment 5 Vincent Untz 2004-12-08 16:17:41 UTC
*** Bug 160744 has been marked as a duplicate of this bug. ***
Comment 6 Josh Lee 2005-01-30 23:24:48 UTC
Try hitting Alt+Print when the focus is on the desktop. The panels get replaced
by  blackness or garbage.
Comment 7 Michaël Arnauts 2005-07-11 16:01:56 UTC
It also happens when a window is moved under the panel, however, the garbage
depends on the application that is screenshotted, when i move the gnome-calc
onder the panel, all I see is black.

I will attach a collage that makes this clear.
Comment 8 Michaël Arnauts 2005-07-11 16:02:17 UTC
Created attachment 48964 [details]
3 screenshots
Comment 9 Michaël Arnauts 2005-07-11 16:04:08 UTC
Comment on attachment 48964 [details]
3 screenshots

Note that the black borders on the screenshots are due to bug 309330
Comment 10 Björn Lindqvist 2005-09-28 15:38:51 UTC
Is this bug even possible to solve correctly since the X server doesn't retain
the image data for occluded windows? Maybe a possible workaround would be to
take the snapshot from the root windows image with the coordinates of the window
you are shapshoting? That would make it so that instead of garbage data the
parts of the overlapping windows are included in the screenshot.
Comment 11 Dan Winship 2005-09-28 15:58:38 UTC
Solutions that would satisfy me include:

  1. Show the hidden contents (which as you say might not be possible).
  2. Show the overlapping window.
  3. Show a gray square, checkerboard pattern, or something else not
     based on the values of random memory, to indicate that the data isn't
     available.
  4. Cut out that part of the screenshot and make it transparent.

I'm dubious about:

  5. Raise the window before screenshotting it (since that may disrupt the
     effect the user was trying to screenshot).

And I think it would be a bad idea to:

  6. Refuse to take the screenshot if the window isn't fully exposed (though
     the save dialog could explicitly point out to the user the fact that
     part of the window didn't get screenshotted).
Comment 12 Jonathan Blandford 2005-09-28 17:09:56 UTC
I'd vote for checkerboard pattern when occluded on older X servers. 
Additionally, we should be able to get the whole window with comoposite.
Comment 13 Björn Lindqvist 2005-09-30 16:24:09 UTC
I don't think using a checkerboard works because you have to determine which
areas of the window that is occluded and that is not easy. Atleast not without
composite as you say. I made a patch which takes the screenshot from the root
window and it seem to work. See the attached screenshot. :)
Comment 14 Björn Lindqvist 2005-09-30 16:25:57 UTC
Created attachment 52863 [details] [review]
Makes it so the screenshot isn't garbled when the active window isn't at the top
Comment 15 Björn Lindqvist 2005-09-30 16:26:47 UTC
Created attachment 52865 [details]
Shows the patch's behaviour
Comment 16 Daniel Holbach 2006-02-24 16:53:30 UTC
https://launchpad.net/distros/ubuntu/+source/gnome-utils/+bug/31794 mentions the issue as well - did the patch receive attention yet?
Comment 17 Emmanuele Bassi (:ebassi) 2006-04-23 18:37:21 UTC
*** Bug 165949 has been marked as a duplicate of this bug. ***
Comment 18 Emmanuele Bassi (:ebassi) 2006-04-23 18:38:10 UTC
the patch seems to fix the bug, and also seems to fix bug #165949.

I'll commit it for the 2.15.0 release, and revert it in case someone complains.

Comment 19 Emmanuele Bassi (:ebassi) 2006-04-24 10:58:19 UTC
*** Bug 332664 has been marked as a duplicate of this bug. ***
Comment 20 Emmanuele Bassi (:ebassi) 2006-09-04 11:13:27 UTC
marking it as FIXED.
Comment 21 Loïc Minier 2007-03-08 14:19:32 UTC
Created attachment 84244 [details] [review]
GNOME 2.14 backport