Add feature to take screenshots of the buggy window

Bug #772336 reported by Abhinav Upadhyay on 2011-04-28
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Abhinav Upadhyay
apport (Ubuntu)

Bug Description

In the comments of bug #357847 ( it was discussed that it would be nice to let apport take screenshot of the buggy window and attach with the bug report.

I am opening this bug to discuss about the possibilities of adding this feature to apport.

In my opinion I always like to attach screenshots with the bug report to make my problem more clear but it takes some effort to do it manually. So for me it is a must have feature.

I have been trying to investigate how it could be accomplished as gnome-screenshot doesn't provide any such feature. Although there is another screenshot taking app "Shutter" which does provide the feature to point and click at a window and take it's screenshot.

I contacted the author of Shutter about how Shutter achieves this. He was kind enough to send me a small piece of Perl code that demonstrates how it could be achieved. I have translated that code to Python and I am attaching it with this comment.

It would be great it someone could test it and give me the feedback about how useful it is.

It depends on python-wnck.

Changed in apport:
assignee: nobody → Abhinav Upadhyay (er-abhinav-upadhyay)
Philip Muškovac (yofel) wrote :

Sounds cool :)

Changed in apport (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged

I have already added the -w/--window option to apport so I could easily add -s/--screenshot feature as well in a similar manner.

I have two questions for this:

1. The screenshot needs to be included with the data that apport uploads to launchpad, where is the code where I should add the relevant bits to attach the screenshot as well.

2. It will add a dependency on python-wnck library , will that be ok ?

Matt Zimmerman (mdz) wrote :

The code in the prototype looks reasonable to me, but I don't know enough about this layer of the X stack to be able to tell if it covers all of the necessary cases.

1. You would do this by adding an item to the ProblemReport dictionary

2. The python-wnck dependency shouldn't be too much of a problem, as it's already in main and quite small.

Hi Matt,

Thanks for reviewing the prototype. This code was working perfectly with Gtk2 but for Oneiric, apport has been ported to Gtk3 using GI. I tried my level best to port this code to Gtk3 and make it work, but the changes in Gtk3 are such that it seems impossible to me to add these feature.

The reason being that Gtk3 developers have removed all the drawing functions from Gdk and instead recommend to use the Cairo API. Now, that requires dependency on an additional library and on top of that the python port of Cairo that is Pycairo has not caught up with the current version of Cairo (as it is not GI based, but a static binding). I asked even the Gtk developers on #Gtk+ , they all seemed to concur on this.

I have another version of this prototype but that also cannot work with Gtk3, just because one function has been removed from the Gtk API.

Martin Pitt (pitti) on 2011-10-05
Changed in apport:
status: New → Triaged
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers