Add feature to take screenshots of the buggy window

Bug #772336 reported by Abhinav Upadhyay
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Apport
Triaged
Wishlist
Unassigned
apport (Ubuntu)
Triaged
Wishlist
Unassigned

Bug Description

In the comments of bug #357847 (https://bugs.launchpad.net/ubuntu/+source/apport/+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.

Revision history for this message
Abhinav Upadhyay (er-abhinav-upadhyay) wrote :

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)
Revision history for this message
Philip Muškovac (yofel) wrote :

Sounds cool :)

Changed in apport (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Abhinav Upadhyay (er-abhinav-upadhyay) wrote :

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 ?

Revision history for this message
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.

Revision history for this message
Abhinav Upadhyay (er-abhinav-upadhyay) wrote :

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)
Changed in apport:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This release of Ubuntu is no longer receiving maintenance updates. If this is still an issue on a maintained version of Ubuntu please let us know.

Changed in apport (Ubuntu):
status: Triaged → Incomplete
Changed in apport (Ubuntu):
status: Incomplete → Triaged
Changed in apport:
assignee: Abhinav Upadhyay (er-abhinav-upadhyay) → nobody
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.