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 166485 - Screenshot applet does not display correctly on multihead display
Screenshot applet does not display correctly on multihead display
Status: RESOLVED FIXED
Product: gnome-utils
Classification: Deprecated
Component: screenshot
trunk
Other Linux
: Normal normal
: ---
Assigned To: Jonathan Blandford
gnome-utils Maintainers
: 308842 313957 314668 333025 352379 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-02-06 20:22 UTC by mallchin
Modified: 2009-02-24 21:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
My xorg config with dual screen setup (1.42 KB, application/x-gzip)
2005-10-14 18:37 UTC, Richard Blumel
  Details
Screen shot from a fresh garnome build (24.76 KB, image/png)
2005-10-14 18:39 UTC, Richard Blumel
  Details
Fixes xinerama desktop screenshot to shoot the whole desktop (450 bytes, patch)
2008-06-02 12:30 UTC, Hal Ashburner
reviewed Details | Review
Screenshot taken after patch applied, c. 650kb (668.06 KB, image/jpeg)
2008-06-02 16:55 UTC, Hal Ashburner
  Details
updated patch to apply with gnome-utils 2.24.0 (635 bytes, patch)
2008-09-29 21:49 UTC, Brian Cameron
committed Details | Review
bgo166485-screenshot-randr-blank-areas.diff (4.41 KB, patch)
2009-02-10 00:51 UTC, Federico Mena Quintero
committed Details | Review

Description mallchin 2005-02-06 20:22:14 UTC
When a screenshot it taken on a multihead display (I have dual setup using
nVidia's twinview extension) the popup dialogue box to save the image is twice
as wide as it should be. The left half consists of the usual image, path and
save buttons whilst the right half is just a blank area. There is no loss in
functionality however it looks rtaher odd, and ought to be fixed.
Comment 1 Vincent Noel 2005-02-07 18:51:51 UTC
Moving to gnome-utils.
Comment 2 Nathan O'Sullivan 2005-03-08 04:45:00 UTC
I'm seeing the same thing.  Left half is the image of my left screen.  Right
half is blank.  

I would expect the right half should be the image of my right screen, so I
disagree with mallchin@blueyonder.co.uk - it appears, there is a loss of
functionality.

Using gnome 2.10.0 on an Nvidia card with xinerama.
Comment 3 mallchin 2005-03-08 12:08:44 UTC
The screenshot is the correct size for me and contains an image of both
displays, it's only the box that appears too large. I suspect twinview tricks X
into thinking there is only 1 screen not 2 (unlike xinerama) thus (if it where
only looking at one screen) it renders the image okay.
Comment 4 Michael Wood 2005-04-16 18:01:20 UTC
I have Xinerama and two different graphics cards and get the same problem,
Screenshot: http://fornax.x3n.me.uk/Screenshot-Save%20Screenshot.png
Comment 5 Sebastien Bacher 2005-05-12 10:31:00 UTC
the ubuntu bugzilla has a bug about this too: https://bugzilla.ubuntu.com/10600

"The gnome-screenshot utility doesn't handle multiple monitors 
(using Ximerama) correctly. It creates a .png of the correct
dimensions, but only captures the contents of a single
montior, and some of the other. This is what it captured of 
my desktop:
http://diamond.nonado.net/misc/gnome-screenshot-badness.png

here's what my desktop really looks like:
http://diamond.nonado.net/misc/real.png

I have an asymetric setup, with 1024x768 on the left monitor,
and 1280x1024 on the right montior (a 17" crt and 17" lcd
respectively). The gfx card is a geforce 6600GT, using the
nvidia binary drivers.

This is an amd64 machine, running hoary, uptodate as of today."
Comment 6 mallchin 2005-05-12 17:56:25 UTC
Fixed for me in Gnome-2.10 :)
Comment 7 Teppo Turtiainen 2005-08-22 19:12:29 UTC
*** Bug 313957 has been marked as a duplicate of this bug. ***
Comment 8 Teppo Turtiainen 2005-08-29 17:50:56 UTC
*** Bug 314668 has been marked as a duplicate of this bug. ***
Comment 9 Teppo Turtiainen 2005-08-29 17:56:41 UTC
Confirming because of the duplicates.
Comment 10 mallchin 2005-08-29 23:07:58 UTC
Still fixed for me using Xinerama...
Comment 11 Teppo Turtiainen 2005-08-30 04:34:09 UTC
One of the duplicates was with 2.11.x.
Comment 12 Steve Frécinaux 2005-08-30 09:45:00 UTC
It did work for me with gnome 2.8.x and gnome 2.10.x. (I reported the bug 314668)
Comment 13 Richard Blumel 2005-10-14 18:37:48 UTC
Created attachment 53486 [details]
My xorg config with dual screen setup
Comment 14 Richard Blumel 2005-10-14 18:39:03 UTC
Created attachment 53487 [details]
Screen shot from a fresh garnome build

I have the same problem listed above, I hope with more info a solution can be
found.
Comment 15 Gilles Dartiguelongue 2005-11-09 23:22:45 UTC
Same bug here using gentoo ~x86 (say unstable).
Using xorg-x11-6.8.2-r6, gnome-2.12 et the free driver of a radeon 9000 pci card.
Xinerama with symetric conf (2x17")
It is a regression since it worked for me in 2.6, 2.8 and 2.10
http://clubnix.esiee.fr/~eva/buggy-shot.png
By the way you can actually see a bug of evolution-2.4 on the top of the
screenshot :)
Comment 16 Daniel Holbach 2005-11-28 17:37:33 UTC
New comment from: https://bugzilla.ubuntu.com/10600

> Do you have the issue with Ubuntu 5.10? That could be a Build-Depends difference
> with Debian...

Sorry for the delay, took me ages to get a chance to install breezy on this
machine. Anyway, short answer is, same bug still exists. Here's a fresh
screenshot, from breezy:
http://diamond.nonado.net/misc/pics/gnome-screenshot-badness-breezy.png



(Somebody please raise Version to 2.12.x - Ubuntu Breezy shipped with 2.12.1)
Comment 17 Stian Jordet 2006-02-12 20:26:44 UTC
It seems that the bug is that gnome-screenshot takes the dimensions of the primary screen, and takes an image of that from, starting from pixel 0 to the left. If the primary screen is to the right, or they have different sizes, everything will be fscked.

Anyway, it should get everything. It used to do that (2.6, 2.8 and 2.10), but have failed to work in 2.12 and (soon to be) 2.14. 

As this is a regression, it's really frustrating!
Comment 18 Sebastien Bacher 2006-03-01 21:05:43 UTC
*** Bug 308842 has been marked as a duplicate of this bug. ***
Comment 19 Sebastien Bacher 2006-03-01 21:05:51 UTC
*** Bug 333025 has been marked as a duplicate of this bug. ***
Comment 20 Matthew Carroll 2006-06-28 18:52:19 UTC
I'm still experiencing this bug on Gnome 2.14.2 (on Ubuntu 6.06). Please raise version. Also, the GIMP correctly captures the entire screenshot, so maybe someone could borrow code from there ;-)

Thanks, Matthew
Comment 21 Michael Wood 2006-08-22 12:42:56 UTC
This bug ought to be closed and a new one opened for this issue. The original issue of the screenshot tool not displaying it's self correctly in mallchin@blueyonder.co.uk's report has been confirmed as fixed. 

New bug: http://bugzilla.gnome.org/show_bug.cgi?id=352379
Comment 22 Hal Ashburner 2008-06-02 12:30:06 UTC
Created attachment 111946 [details] [review]
Fixes xinerama desktop screenshot to shoot the whole desktop

Attach is the patch which fixes the symtom on gnume-utils-2.20.0.1
I think this is covering up the root cause of the issue. Which is that XShapeGetRectangles (GDK_DISPLAY() GDK_ROOT_WINDOW(), ...) returns a single rectangle for the root window that is only the first X screen. Either the code that assumes GDK_ROOT_WINDOW() gives you something that represents the entire desktop is incorrect, or XShapeGetRectangles() has a bug. I don't know which, I'm hoping someone on #gtk+ will direct me someplace useful...
Comment 23 Hal Ashburner 2008-06-02 15:26:37 UTC
Upon reflection I believe this is in fact the correct patch.
This situation only comes up when taking a screenshot of the entire desktop. Whatever we do we have to check to see whether this is the GDK_ROOT_WINDOW(). We can do something funky like:
 
screen_count = ScreenCount(GDK_DISPLAY ());
for(i = 0; i < screen_count; ++i) {
    rectanlges = XShapeGetRectangles (GDK_DISPLAY, RootWindow(GDK_DISPLAY(), i), ShapeBounding, &rectangle_count, &rectangle_order);
 /* etc... */
}

I think this would be the wrong way to go. We can't handle non rectangular screens. If there are multiple screens of different sizes & resolutions we are going to have dead regions in the overall screenshot no matter what. Breaking the root window into multiple screens and stitching back together is needless complexity, there's no benefit there, and we have to check if the window passed in is the root window anyway so the patch does the check exactly once and minimises the the  resultant headache.
Comment 24 Hal Ashburner 2008-06-02 15:36:48 UTC
duplicated by Bug 352379 ?
Comment 25 Hal Ashburner 2008-06-02 16:55:16 UTC
Created attachment 111970 [details]
Screenshot taken after patch applied, c. 650kb
Comment 26 Emmanuele Bassi (:ebassi) 2008-08-10 19:14:18 UTC
I don't have a xinerama set up, so I can't confirm this works. if it doesn't cause any regression I can apply, but I'd like confirmation by at least another user that the patch works.
Comment 27 Matt Keenan (IRC:MattMan) 2008-09-05 12:00:29 UTC
Just tried out the attached patch, on OpenSolaris with gnome 2.24 stack installed
and running xinerama, and this does indeed display the complete captured screen.
Comment 28 Brian Cameron 2008-09-29 21:49:49 UTC
Created attachment 119618 [details] [review]
updated patch to apply with gnome-utils 2.24.0

Updated patch to apply against the latest 2.24.0 code.
Comment 29 Federico Mena Quintero 2009-02-10 00:37:56 UTC
*** Bug 352379 has been marked as a duplicate of this bug. ***
Comment 30 Federico Mena Quintero 2009-02-10 00:51:55 UTC
Created attachment 128346 [details] [review]
bgo166485-screenshot-randr-blank-areas.diff

We also need this patch to blank out the invisible areas for non-rectangular multi-monitor setups.  See https://bugzilla.novell.com/show_bug.cgi?id=381135 about this.
Comment 31 Louis Frayser 2009-02-10 16:25:01 UTC
Snapshot is working well for me now in gnome-utils-2.24.1, was capturing just one monitor previously. I'm not sure which of 2.24.0 or 2.24.1 was the update that fixed this. Running radeon 9200, MergedFB, two same-sized monitors, XOrg 7.2 with open sourced radeon driver on Gentoo.

Thanks
Comment 32 Cosimo Cecchi 2009-02-24 17:49:18 UTC
Federico, thanks for the patch please commit to trunk.
Comment 33 Federico Mena Quintero 2009-02-24 21:52:15 UTC
Committed both patches to trunk (r8432, r8433):

2009-02-24  Federico Mena Quintero  <federico@novell.com>

	https://bugzilla.novell.com/show_bug.cgi?id=381135
	http://bugzilla.gnome.org/show_bug.cgi?id=166485

	* screenshot-utils.c (screenshot_get_pixbuf): If we are in a
	multi-monitor setup that is not rectangular (for example, if it is
	L-shaped due to monitors of different resolutions), we need to
	blank out the "invisible" areas from the rectangular root window.
	Otherwise, the screenshot will contain content that the user
	cannot actually see.  Call a helper function to blank out these areas.
	(mask_monitors): New helper function.

	* screenshot-utils.c (screenshot_get_pixbuf): Don't try to shape
	the root window.  Patch by Hal Ashburner <hal@ashburner.info>