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 587101 - black bar in in single window or area screenshot with multiple screens
black bar in in single window or area screenshot with multiple screens
Status: RESOLVED FIXED
Product: gnome-utils
Classification: Deprecated
Component: screenshot
2.32.x
Other All
: Normal normal
: ---
Assigned To: gnome-utils Maintainers
gnome-utils Maintainers
: 591435 616568 645904 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-06-27 01:51 UTC by Edwin Grubbs
Modified: 2013-03-14 14:31 UTC
See Also:
GNOME target: ---
GNOME version: 2.31/2.32


Attachments
Bad screenshot with monitors aligned at bottom (33.98 KB, image/png)
2009-06-27 01:52 UTC, Edwin Grubbs
  Details
Good screenshot with monitors aligned at top (37.08 KB, image/png)
2009-06-27 01:53 UTC, Edwin Grubbs
  Details
Fedora 13 (properties) (25.05 KB, image/png)
2010-07-21 13:07 UTC, jan
  Details
Disable masking for area or window screenshots. (2.58 KB, patch)
2010-11-05 21:26 UTC, Ian Westcott
committed Details | Review

Description Edwin Grubbs 2009-06-27 01:51:42 UTC
Please describe the problem:
Using gnome-screenshot to take a picture of a window or an area of the screen yields an image with a black bar at the top. I discovered that gnome-screenshot will work correctly if I align the top edge of both my monitors instead of the bottom edge. (See screenshots.) Taking a picture of the entire desktop works fine since the black bar only appears in the gap left by the smaller monitor.

Steps to reproduce:
1. Configure multiple monitors of differing sizes in Ubuntu Jaunty.
2. Open the Display preferences, and align the bottom of edges of both monitors. 
3. Use gnome-screenshot to take a picture of a window or an area of the screen.


Actual results:
There is a black bar at the top of the image covering part of the screenshot.

Expected results:
No black bar.

Does this happen every time?
Yes

Other information:
Comment 1 Edwin Grubbs 2009-06-27 01:52:53 UTC
Created attachment 137443 [details]
Bad screenshot with monitors aligned at bottom
Comment 2 Edwin Grubbs 2009-06-27 01:53:59 UTC
Created attachment 137444 [details]
Good screenshot with monitors aligned at top
Comment 3 Marius Gedminas 2009-12-15 16:26:25 UTC
Bug still present in GNOME 2.28.1 (as distributed by Ubuntu).

My dualhead config is as follows:

  Monitor 0: 1280x800 at (0, 224)
  Monitor 1: 1280x1024 at (1280, 0)

and the topmost 224 pixels of any screenshot taken with Alt+PrintScreen are black (except for the image of a mouse cursor, if it happens to be in that part of the window).

Small correction: the top-left 1280x224 area of any screenshot is black; if I make the window wider than 1280 pixels, the area in the top-right corner is undamaged.
Comment 4 Eddie Ringle 2010-02-14 03:39:30 UTC
Can confirm that this bug still exists in the Ubuntu Lucid alphas, running gnome-utils version 2.29.5-ubuntu2.
Comment 5 amanda 2010-04-22 22:16:49 UTC
*** Bug 616568 has been marked as a duplicate of this bug. ***
Comment 6 amanda 2010-04-22 22:18:46 UTC
(In reply to comment #5)
> *** Bug 616568 has been marked as a duplicate of this bug. ***

More screenshots at 616568
Comment 7 amanda 2010-04-23 21:56:07 UTC
I just spent a little more time screwing around and here's what more I learned about the behavior on my screen:

If I cycle through Fn-F7 twice, I find myself with a good looking dual display from which I *can* take good screenshots. This also seems to re-align my displays so that the top edges are parallel. 

Similarly, if I manually realign my displays so that the top edges are parallel, I can also take good screenshots.
Comment 8 jan 2010-07-21 13:07:40 UTC
Created attachment 166279 [details]
Fedora 13 (properties)
Comment 9 jan 2010-07-21 13:07:48 UTC
Confirmed with Fedora13 (gnome-utils-2.30.0)

See attached screenshot "properties"
Comment 10 Ian Westcott 2010-10-05 23:35:30 UTC
I'm just going to throw this out there, looking at this issue with gnome-utils 2.26.0 (we're using Fedora 11) as well as 2.30.0, it seems like the issue is that screenshot_utils.c:mask_monitors() is getting called with a pixbuf of the screenshot, regardless of whether the screenshot is of the full desktop, a single application, or an area. The problem occurs when the pixbuf is smaller than the root display, and if the monitor that houses the top-left corner of the root display is smaller than the monitor on which the screenshot of the window or area was taken. The pixbuf passed to mask_monitors has no positioning information, only a size, so the function has no way of knowing where to crop (or if the crop is necessary) -- it always applies the crop as if the screenshot image was located at pixel position 0,0. 

The quick an easy fix for me is to include a check to only call mask_monitors() if the screenshot is of the entire desktop. I think in general, I wouldn't want a screenshot of a window or area to be blanked even if part of it does hang off the edge of the monitor, but if that were necessary, then the position of the screenshot pixbuf would have to be passed so that it can be positioned properly for the masking.
Comment 11 Ian Westcott 2010-10-05 23:39:40 UTC
Oh, and an easy way for me to reproduce this (works every time): Set up X to use two monitors. The left runs at 1600x1200, the right monitor runs at 2560x1600. Open a terminal on the right monitor, full-screen it, and run gnome-screenshot -w from that terminal. It will pop up a 2560x1600 image with the bottom-left 1600x400 pixels blacked out.
Comment 12 Ian Westcott 2010-11-05 21:24:25 UTC
The more I thought about this, the more I felt I couldn't think of a situation where I wanted black bar masking if I was drawing out an area for a screenshot, nor did I want a black bar overlaid on the window I was taking a picture of even if part of that window was off-screen. So I wrote a patch to gnome-utils to only enable masking if the screenshot is of the entire desktop. The patch is against 2.26.0, but it applies cleanly all the way up to 2.32.0.
Comment 13 Ian Westcott 2010-11-05 21:26:09 UTC
Created attachment 173916 [details] [review]
Disable masking for area or window screenshots.
Comment 14 Emmanuele Bassi (:ebassi) 2010-11-06 14:40:25 UTC
Review of attachment 173916 [details] [review]:

the patch looks good from a cursory glance.

Cosimo should have another look.

::: gnome-screenshot/gnome-screenshot.c.orig
@@ +677,3 @@
+   */
+  if (include_mask)
+      mask_monitors (screenshot, root);

slight code style issue: only 2 space indentation.
Comment 15 Vincent Greene 2010-12-08 00:13:51 UTC
I can confirm that the bug exists as described for multiple monitors with the left most being a lower resolution monitor aligned at the bottom of the right monitor.  I applied the patch submitted above and verified that this corrects the problem.  I'm looking forward to this being corrected in the distribution.
Comment 16 Vincent Greene 2010-12-08 00:34:10 UTC
Forgot to mention, I tested at version 2.30.0-0ubuntu1
Comment 17 Eric Piel 2011-01-26 15:44:08 UTC
I also agree that it's fine that when doing region selection no mask is applied, some kind of "advanced feature" ;-) 

Any hope to apply this patch? Emmanuele, how can we ask Cosimo to have another look at it? Do you need a new version with the indentation fixed?

BTW, bug #591435 seems a dupe of this bug.
Comment 18 Emmanuele Bassi (:ebassi) 2011-01-26 16:32:54 UTC
(In reply to comment #17)
> Any hope to apply this patch? Emmanuele, how can we ask Cosimo to have another
> look at it?

you just did. Cosimo is Cc:'ed in on gnome-screenshot bugs.

> Do you need a new version with the indentation fixed?

it's always the best option; this way, we can just use git-bz and apply the patch/close the bug in one go.

> BTW, bug #591435 seems a dupe of this bug.

looks like it, yes.
Comment 19 Emmanuele Bassi (:ebassi) 2011-01-26 16:32:58 UTC
*** Bug 591435 has been marked as a duplicate of this bug. ***
Comment 20 Rolf Leggewie 2011-02-27 06:28:53 UTC
confirming from own experience and duplicate bug reports
Comment 21 Hendrik 2011-07-15 15:33:18 UTC
I still have this problem with Gnome 2.32.1 on Ubuntu 11.04. What's with the patch from nine months ago?
Comment 22 Rolf Leggewie 2011-07-21 13:20:53 UTC
patch works fine in Ubuntu Lucid
Comment 23 Rolf Leggewie 2011-07-21 13:25:21 UTC
Can somebody please confirm whether this is still a problem with gnome-utils 3.x?  The patch only applies to 2.x source.
Comment 24 Michael Bienia 2011-07-24 13:30:48 UTC
I can still confirm this with gnome-screenshot 3.1.2-0ubuntu2 from Ubuntu oneiric.

Taking a screenshot of a window (the window has to be higher than the height of the smaller screen to see it) has still a black block where the nonvisible area is in my desktop.
Comment 25 Cosimo Cecchi 2011-09-17 03:47:10 UTC
*** Bug 645904 has been marked as a duplicate of this bug. ***
Comment 26 Cosimo Cecchi 2011-09-17 03:52:58 UTC
Attachment 173916 [details] pushed as 56f50c7 - Disable masking for area or window screenshots.

Sorry for the long delay, I pushed this to master now.
Comment 27 Aleksandr Stepanov 2013-03-14 14:31:40 UTC
i using nvidia tweanview and i get transparent or black window screeshots.
GNOME Shell 3.6.3.1
gnome-screenshot 3.6.1-1
Archlinux