"Include the window border" doesn't work by default (with compiz)

Bug #74008 reported by Corey Burger
310
This bug affects 48 people
Affects Status Importance Assigned to Milestone
Compiz
Won't Fix
Medium
gnome-utils
Won't Fix
Medium
gnome-utils (Ubuntu)
Fix Released
Low
Unassigned
Declined for Lucid by Sebastien Bacher

Bug Description

Binary package hint: compiz

stock feisty, stock compiz, stock xorg. Taking screenshots with alt-sctreenshot with gnome-screenshot fails to capture the window decorators.

Revision history for this message
Stu Hood (stuhood) wrote :

Confirmed

Changed in compiz:
status: Unconfirmed → Confirmed
Revision history for this message
In , Corey Burger (corey.burger) wrote :

stock feisty, stock compiz, stock xorg. Taking screenshots with alt-sctreenshot
with gnome-screenshot fails to capture the window decorators.

Filed at https://bugs.launchpad.net/distros/ubuntu/+source/compiz/+bug/74008

Revision history for this message
Corey Burger (corey.burger) wrote : Re: Taking screenshots of the invidual window fails to capture window decorators

This is still confirmed with 0.3.4

Changed in compiz:
status: Unknown → Confirmed
Revision history for this message
In , Davidr-novell (davidr-novell) wrote :

That's because gnome-screenshot assumes that the window manager is reparenting
client windows into frame windows. Compiz doesn't do that.

This is not a compiz bug. gnome-screenshot and other screenshot utilities that
make the same assumption should be fixed.

Revision history for this message
In , Corey Burger (corey.burger) wrote :

Filed in bugzilla.g.o

Changed in compiz:
status: Confirmed → Rejected
Changed in gnome-utils:
status: Unknown → Unconfirmed
Revision history for this message
In , Emmanuele-emmanuelebassi (emmanuele-emmanuelebassi) wrote :

from the bug on bugzilla.g.o:

gnome-screenshot does not assume anything: the window border are included only
if the "include-border" GConf key is set to TRUE, or command line argument is
given.

the problem is that the common path used by the include-border option doesn't
seem to work with compiz, so "include-border" is not honoured.

gnome-screenshot tries to find the current window using the _NET_ACTIVE_WINDOW
X property and then, if 'include-border' is set to TRUE, it walks back the
window chain until it finds the window frame.

I don't know why compiz doesn't do the reparenting, and neither understand why
it can't behave like every other window manager; if compiz authors wish to
share how gnome-screenshot should fix this misbehaviour, I'm all ears.

Revision history for this message
In , Davidr-novell (davidr-novell) wrote :

(In reply to comment #3)
> from the bug on bugzilla.g.o:
>
> gnome-screenshot does not assume anything: the window border are included only
> if the "include-border" GConf key is set to TRUE, or command line argument is
> given.
>
> the problem is that the common path used by the include-border option doesn't
> seem to work with compiz, so "include-border" is not honoured.
>
> gnome-screenshot tries to find the current window using the _NET_ACTIVE_WINDOW
> X property and then, if 'include-border' is set to TRUE, it walks back the
> window chain until it finds the window frame.
>
> I don't know why compiz doesn't do the reparenting, and neither understand why
> it can't behave like every other window manager; if compiz authors wish to
> share how gnome-screenshot should fix this misbehaviour, I'm all ears.

The most important reason for why we don't do reparenting is that we don't
necessarily want to use the same visual for the decorations as the client
window. We want to always have an alpha channel present in our decorations but
most client windows use visuals without and alpha channel. If you reparent a
window using a non-ARGB visual into one using an ARGB visual when using the
composite extension to redirect top-level windows, an automatic redirect is
required on the server side to ensure that the alpha bits are correct. This
automatic redirect requires huge memory resources and adds a significant
performance impact. There's some other reasons too, like that it allows us to
compress decorations and save some additional video memory, reparenting also
make the WM code more complex, no reason to do it on a composited desktop so
it's nice to avoid it...

One way to grab a window including the decorations is to look at the
_NET_FRAME_EXTENTS property on the client window. Fetch the client window
geometry, add the frame extents from the _NET_FRAME_EXTENTS property and grab
the root window rectangle that you get from that.

This should work with any EWMH compliant window manager. It wont work with other
window managers that don't support the _NET_FRAME_EXTENTS property so keep the
old frame grabbing code for those cases.

Some additions to the EWMH spec is required if you want to be able to grab the
full contents of a partially covered window. I think it makes a lot of sense to
be able to do this so I could start by implementing a proposed mechanism in
compiz for this. Something like this would work:

- screenshot client sends a client message to wm, telling it that it likes to
acquire a pixmap containing the specific window.
- wm allocates a pixmap of appropriate size and render the window including it's
decorations to it.
- wm sends a client message back to the screenshot client, telling it about the
pixmap which now contains the window.

This mechanism would even be able to capture possible transformations and other
modifications done by the compositing manager to windows.

Changed in gnome-utils:
status: Unconfirmed → Needs Info
Revision history for this message
In , Emmanuele-emmanuelebassi (emmanuele-emmanuelebassi) wrote :

david, thanks for the explanation and the tips.

Revision history for this message
Travis Watkins (amaranth) wrote : Re: Taking screenshots of the invidual window fails to capture window decorators

Changing to gnome-utils as specified by upstream.

Changed in gnome-utils:
assignee: nobody → desktop-bugs
importance: Undecided → Low
Changed in gnome-utils:
status: Needs Info → Unconfirmed
Revision history for this message
Kurt Kraut (kurtkraut) wrote : Still happens in Gutsy

This problem still happens in Gutsy with these versions:

compiz 1:0.5.2+git20070918-0ubuntu5
gnome-utils 2.20.0.1-0ubuntu1

Revision history for this message
gabe (urmom111) wrote : Re: Taking screenshots of the invidual window fails to capture window decorators

Confirmed as of Gutsy Beta on 10-7-2007.

Changed in gnome-utils:
status: Confirmed → Triaged
Revision history for this message
David Prieto (frandavid100-gmail) wrote :

I opened a bug in the compiz fusion forums regarding the issue, this is what a member replied:

"gnome-screenshot relies on finding the parent window containing the currently focused widget, then the parent of that, and the parent of that, all the way up to the top level, where it is presumed that the parent just before reaching the desktop window is the window border. Since the window borders drawn by Compiz's window decorators aren't actually part of the window, the last parent that gnome-screenshot sees before hitting the desktop window is the focused window, minus the borders.

Compiz plugins know offhand the exact size and position of every window, so they don't need to look for parents, and don't encounter the same problem.

... That's as much sense as I was able to make from the source code, anyway. *shrug* What I mean is, even though it may seem like an easy problem to fix, it may not be."

http://forum.compiz-fusion.org/showthread.php?t=4957

Revision history for this message
hauke (hauke-heesch) wrote :

Confirmed in Ubuntu Hardy Alfa 5.

Revision history for this message
Conor (ronocdh) wrote :

Confirmed running Gutsy. Thanks for the informative post, David!

Revision history for this message
Eduard Urbach (webmaster-blitzprog) wrote :

Confirmed.
Ubuntu 7.10
compiz 0.6.1
gnome-screenshot 2.20.0.1

Revision history for this message
Stéphane Maniaci (stephh) wrote :

Confirmed in Hardy Beta

Revision history for this message
Fractal (guillaume-brunerie) wrote :

Confirmed in the final Hardy release with Compiz 0.7.4

Revision history for this message
Jeremy LaCroix (jlacroix82-deactivatedaccount) wrote :

Confirmed in Intrepid.

Revision history for this message
chewearn (chewearn) wrote :

Confirmed in Intrepid beta.

Revision history for this message
mihai.ile (mihai.ile) wrote :

Well is there anything that can be done about this?
This bug has 2 years...

Revision history for this message
asdfghjklasdfghjkl (asdfghjklasdfghjkl-deactivatedaccount-deactivatedaccount) wrote :

Confirmed in Intrepid with gnome-utils version 2.24.1-0ubuntu1

Does not work from the console, not with -b switch either. I did not try with metacity, only with compiz.
When used from console, prints out another bug regarding the new Intrepid theme:

eetu@XPS-2:~$ gnome-screenshot -b -w
/usr/share/themes/Human/gtk-2.0/gtkrc:273: Kuvatiedostoa ei löytynyt pixmap_path:sta: "panel_bg.png"
/usr/bin/scim
6606
/usr/bin/scim
6606
eetu@XPS-2:~$

That part in english says "Picture file not found in pixmap_path".

Revision history for this message
asdfghjklasdfghjkl (asdfghjklasdfghjkl-deactivatedaccount-deactivatedaccount) wrote :

Confirmed by multiple users (including me) even with the current version.

Changed in gnome-utils:
status: Triaged → Confirmed
Changed in gnome-utils:
status: Confirmed → Triaged
Revision history for this message
Jessie Lawrence (nightwolf177-deactivatedaccount) wrote :

what the hell? i thought this was supposed to be fixed in intrepid!

one of the things that gnome was bragging about their 2.24 release is that they fixed the bug in the screenshot tool that failed to capture window decorators when a compositor was enabled.
 ____ _____ _ _
| ___|| _ || || |
| |_ | |_| || || |
| _| | _ || || |__ _
|_| |_| |_||_||____||_|

Changed in gnome-utils:
status: New → Won't Fix
Revision history for this message
chewearn (chewearn) wrote :

I am seeing this bug in Intrepid.

I have written a bash script to workaround the problem, using a combination of xdotool imagemagick and scrot.

(Note: xdotool only available in the repository from Intrepid onwards).

I posted the script in my blog, but I'm not sure if it's appropriate to link to the post here. If you are interested, Google "Ubuntu window screenshot with frame" should bring you to the post.

Revision history for this message
Martin Olsson (mnemo) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

the bug should be fixed in the 2.25 version which will be uploaded to jaunty

Changed in gnome-utils:
status: Triaged → Fix Committed
Revision history for this message
Sebastien Bacher (seb128) wrote :

the new version is in jaunty

Changed in gnome-utils:
status: Fix Committed → Fix Released
Revision history for this message
Fernando Muñoz (fmunozs) wrote :

Gnome's developer marked this as won't fix, they claim Gnome's window manager is not Compiz, but metacity. So Ubuntu should change or provide a new tool for taking screenshots since Ubuntu enables compiz by default on capable hardware.

Revision history for this message
Fernando Muñoz (fmunozs) wrote :

Sorry, I did not read Sebastian comment, I will try Jaunty

Revision history for this message
Ilmari Vacklin (wolverian) wrote :

This bug still exists on Jaunty here.

Revision history for this message
Saivann Carignan (oxmosys) wrote :

Since this bug can still be reproduced with gnome-utils 2.26.0-0ubuntu1 and according to last comments, I'm re-opening this bug report. However, status here is unclear.

Sebastian Bacher : Any idea about what happened with the awaiting fix in 2.25.0? Or should this really be closed as won't fix :-/ ?

Changed in gnome-utils (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

read the upstream bug for details

Changed in gnome-utils (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Michael Rooney (mrooney) wrote :

So upstream has dropped this bug due to compiz not being a part of Gnome; they say it is in the distros park now if they are shipping compiz. That seems pseudo-fair, so perhaps we should untriage this from the upstream unless we decide to follow their decision which doesn't seem wise as we DO ship compiz. Perhaps we can do a good job 98% of the time by using the mentioned approach: "take the _NET_WM_FRAME_EXTENTS area and get the corresponding area of the screen".

Revision history for this message
Sebastien Bacher (seb128) wrote :

the upstream status could probably be changed, they might not be shipping compiz but that's still a valid request for them especially that many distribution does use compiz

Revision history for this message
Fernando Muñoz (fmunozs) wrote :

The mainteiner for gnome-utils doesn't seem to care about that. I noted the fact that Compiz was being enabled by default on capable hardware with Ubuntu, read the maintainers answer on comment 11: http://bugzilla.gnome.org/show_bug.cgi?id=387809#c11

Revision history for this message
David Balažic (xerces8) wrote :

For chrissake, if you can't fix it, then at least remove the nonworking "Include the window border" option !

Ubuntu 9.04
gnome-utils 2.26.0-0ubuntu1

Revision history for this message
Fernando Muñoz (fmunozs) wrote :

If there is no fix for this, Can we get a better tool to take screenshots preinstalled like shutter [1]?

[1] http://shutter-project.org/

Revision history for this message
Ralf Ebert (info-ralfebert-deactivatedaccount) wrote :

Still happening for 9.10 and gnome-utils 2.28.1-0ubuntu1.
Shutter works, but doesn't manage to capture the alpha channel correctly for the rounded window corners when compiz is activated.
It would be fine if Ubuntu could come with a screenshot utility that is able to capture window screenshots with correct alpha with and without compiz.

Revision history for this message
Lasse Havelund (lhavelund) wrote :

This bug has now been open for over three years. Are we going to get a fix any time soon?

Revision history for this message
Felix Dreissig (f30) wrote :

@Lasse: Hope dies last, but I don't see why after such a long time there should suddenly be a fix.
Looks like nobody really cares about that problem, which I find very annoying as a main feature of a tool shipped with Ubuntu by default just doesn't work.

Revision history for this message
Martin Olsson (mnemo) wrote :

The maintainers of compiz and the GNOME screenshot utility both think that the other one should fix it in their end. Ways of break this stalemate include:

* Ubuntu could choose to maintain a patch to the GNOME code even though GNOME refuses to merge it upstream. This sort of makes sense because Ubuntu has already deliberately chosen not to use the default window manager (metacity) so Ubuntu is the entity that caused the screenshoting to break (everything always worked well in the upstream version).

* Writing a decent screenshot plugin for compiz (that looks and feels like the GNOME one because the GNOME utility is pretty nice I think) and have Ubuntu switch to that by default (it's indeed reasonable that each window manager implements code for taking a screenshot, since each window manager stores the window data / bitmaps differently).

* Maybe it will be possible to stop using compiz in Ubuntu once Mutter is released (I've no expertise in this area, I'm really just speculating)?

* Or maybe someone could come up with a good patch that fixes the screenshot utility but that is still acceptable for upstream GNOME.

Revision history for this message
Scott (scott-l-barlow) wrote :

As a work around for those annoyed by this...I've been using GIMP to take images - it will include the window decoration from Compiz. You could also check out this script someone wrote here (note that I have NOT tested it myself....):
http://blog.chewearn.com/2008/12/11/ubuntu-window-screenshot-with-frame/

Revision history for this message
Scott Ritchie (scottritchie) wrote :

So, months later, I have to ask -- has someone tried approaching the two upstreams again?

Revision history for this message
Martin Olsson (mnemo) wrote :

ebassi posted some interesting info on the upstream GNOME bug now; about both GTK client side decorations (nice but won't completely solve this problem for all apps though) and also that upstream compiz have transitioned to "reparenting of the window inside a frame" which will probably solve this bug.

I wonder if the upstream compiz commit can be backported to Lucid? I don't even know if it's a single commit though or which commit/branch it is; if someone could find it that would be really nice. I suppose it's hiding somewhere in here:
http://gitweb.compiz.org/

Revision history for this message
Eric Appleman (erappleman) wrote :

Can we get this bug elevated to papercut status?

Revision history for this message
Martin Olsson (mnemo) wrote :

I bet the papercut team would reject it as-is on the grounds that it's not trivial to fix. In case someone finds the upstream compiz commit that fixes it, cherry picking that commit might be trivial enough to merit a papercut though.

Revision history for this message
Isak Frants (isakfrants) wrote :
Revision history for this message
YannUbuntu (yannubuntu) wrote :

Dear all, no news about this ? what about the code suggested by Isak ?
it is quite a visible bug in Ubuntu...

Revision history for this message
Kona-chan (kona-chan) wrote :

Linux way: 3.5-year-old unfixed bug.

Why won't Canonical understand the fact that such minor bugs are at least as important as "critical" bugs or even are more important because they are *really* frustrating as they occur while performing daily simply actions? Oh, right, they're now working on global menu applet and some other mac-style stuff I don't need and, more important, I don't want. If you make Ubuntu look exactly like Mac OS, it won't become Mac OS, neither won't become more user-friendly, at last until there exists such bugs lasting for years.

Sorry for offtopic. I can confirm this bug in Karmic.

Revision history for this message
autostatic (autostatic) wrote :

No window borders are captured with the gnome-screenshot tool in Lucid Lynx 10.04 either.

Best,

Jeremy

Revision history for this message
Sun Ning (classicning) wrote :

Nearly four years.
Hope this could be fixed.

Changed in gnome-utils (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → nobody
Changed in compiz:
importance: Unknown → Medium
status: Invalid → Won't Fix
Changed in gnome-utils:
importance: Unknown → Medium
Revision history for this message
David Balažic (xerces8) wrote :

Same in ubuntu-10.10-desktop-i386.iso live env. (GNOME 2.32)

Revision history for this message
Petrus Yarus (c477823) wrote :

arrrgh! is't not fixed in maverick yet.

Revision history for this message
fabrixx (fabrixx) wrote :

Condirmed Ubuntu 10.10

Revision history for this message
Delan Azabani (azabani) wrote :

The last seven comments have been of little use and are frankly a waste of space. Please refrain from 'confirming' the bug with 'me too' comments or 'nagging' for a fix.

Revision history for this message
Sam_ (and-sam) wrote :
Revision history for this message
Sam_ (and-sam) wrote :

Came around this issue since I've wanted to contribute a screenshot for package description, where it's requested:
> You need not artificially switch off your window decorations.
http://screenshots.debian.net/upload

Achieve it with Compiz: enable screenshot plugin (via CCSM or gconf-editor), open the app and draw it with <Super>+MouseButton1, which is standard but can be altered to other shortcut.
Actually the plugin enables a user to draw any part of anything as rectangle and for other functions as delay, one may use gnome-screenshot or any other.

Changed in compiz:
importance: Medium → Unknown
Changed in compiz:
importance: Unknown → Medium
Revision history for this message
J.G. (j.gorski) wrote :

workaround: Keys Alt + PrtSc captures the open window, and Save Screenshot dialog appears.

Revision history for this message
Greg A (etulfetulf) wrote :

On 10.10 that doesn't work because of Bug 642792

Revision history for this message
Sam_ (and-sam) wrote :

Greg, that's not related to compiz. My comment from 2010-12-18 was regarding 10.10 and due to the mentioned Bug (which is btw. questionable reading the comments) I've assigned Shift+Print to take a screenshot, still with compiz it doesn't incl. window decorations (borders).

Revision history for this message
Sergey Basalaev (sbasalaev) wrote :

Is this bug still actual? Everything works for me.
Ubuntu 11.10, Gnome Classic

Revision history for this message
Goyo (goyodiaz) wrote :

Closing since it works in Oneiric (Gnome shell and Unity).

Changed in gnome-utils (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
bojojo@orange.fr (bojojo-orange) wrote :

"[Bug 74008] Re: Include the window border doesn't work by default (with compiz)"
Samantha \(aka Sam\) doc

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.