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 171151 - showing the cursor in the screenshot
showing the cursor in the screenshot
Status: RESOLVED FIXED
Product: gnome-utils
Classification: Deprecated
Component: screenshot
trunk
Other Linux
: Normal enhancement
: ---
Assigned To: Jonathan Blandford
gnome-utils Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-03-21 23:47 UTC by Dan Winship
Modified: 2008-04-07 14:45 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
the code (15.88 KB, patch)
2005-03-21 23:48 UTC, Dan Winship
none Details | Review
completed patch (23.03 KB, patch)
2005-07-08 01:42 UTC, Dan Winship
none Details | Review
alternative patch (8.56 KB, patch)
2008-03-17 04:46 UTC, Matthias Clasen
committed Details | Review

Description Dan Winship 2005-03-21 23:47:45 UTC
For some kinds of screenshots, you really want the cursor to be visible, to
make it clear what's going on. (Screenshots of drag-and-drop are probably the
biggest example).

This patch adds support to gnome-panel-screenshot for that. Mostly. It:
  - uses Xfixes to get the cursor image
  - adjusts the location according to whether it's a fullscreen or window
    snapshot, and whether or not there's a border
  - adds a checkbox to the dialog allowing you to decide whether or not
    to include the cursor (or rather "pointer", as the doc guidelines say
    to call it) in the screenshot
  - updates the preview to reflect the checkbox

But it doesn't actually support saving the screenshot with the cursor in
it, because the save code is kinda weird and I had no idea what the right
way to do that would be.
Comment 1 Dan Winship 2005-03-21 23:48:47 UTC
Created attachment 39038 [details] [review]
the code
Comment 2 Jonathan Blandford 2005-03-29 15:57:38 UTC
So, implementing this in the save code is a little funny.  The way it does
saving is by forking and calling gdk_pixbuf_save() in the child so that we have
a copy on disk (as gdk_pixbuf_save() can take a noticeable amount of time on
fullscreen shots. )  We then call gnome_vfs_xfer() to get the image to the right
location once chosen.  It also makes DnD nicer, as we have the file saved when
you start a target.

People have requested other saving extentions, though (pdf, gif..) so this old
approach might be wrong.  Or we could just save over the old one when you change
formats/or show the cursor.
Comment 3 Dan Winship 2005-07-08 01:42:03 UTC
Created attachment 48806 [details] [review]
completed patch

Finished patch, with saving code. I just added a screenshot_save_again()
function that cancels the currently-pending save and starts a new one (using
the same callback as before), and then tweaked things to make sure you can't
accidentally save the old screenshot while it's busy writing the new one.
Comment 4 Brent Smith (smitten) 2006-03-11 16:00:36 UTC
works here.  I'm using to update the cursor images for the UG in 2.14.

although it doesn't apply against head (I checked out a copy of gnome-utils from July 8th) and I had to run it from the checkout directory, otherwise it couldn't find the glade file.

See http://bugzilla.gnome.org/show_bug.cgi?id=330123
Comment 5 Dan Winship 2007-02-24 14:43:19 UTC
poke!

http://davyd.livejournal.com/208614.html

What's the status here? (besides "the patch doesn't apply to trunk")
Is the idea bad? Is the UI bad? Is the code bad?
Comment 6 Emmanuele Bassi (:ebassi) 2007-02-25 11:02:17 UTC
too late for the 2.18 release: it changes the UI.  also, I'll have to move the checkbox into the new interactive dialog (and not in the save dialog) and add a command line switch for it.

definitely pinned down for 2.19.
Comment 7 Matthias Clasen 2008-03-17 04:45:29 UTC
Patch doesn't look quite correct to me; XFixesGetCursorImage gives you premultiplied alpha, gdk-pixbuf uses non-premultiplied alpha.

Before finding this bug, I've independently written a similar patch. 
I'll attach it below. Maybe that helps with closing this bug...
Comment 8 Matthias Clasen 2008-03-17 04:46:32 UTC
Created attachment 107425 [details] [review]
alternative patch

Note, my patch misses some of the configury bits from Dans.
Comment 9 Matthias Clasen 2008-03-17 05:01:41 UTC
By removing the pointer grab, my patch also fixes the screenshootability of tooltips and menus...
Comment 10 Emmanuele Bassi (:ebassi) 2008-04-07 14:24:28 UTC
patch looks fine. Matthias, can you apply it with the configure fixes as well? otherwise I'll try to do it later today.
Comment 11 Matthias Clasen 2008-04-07 14:45:52 UTC
2008-04-07  Matthias Clasen  <mclasen@redhat.com>

        Bug 171151 – showing the cursor in the screenshot

        * screenshot-utils.h:
        * screenshot-utils.c (screenshot_get_pixbuf): Optionally
        include the cursor in the image.
        (screenshot_grab_lock): Don't grab the pointer while taking
        the screenshot.

        * gnome-screenshot.schemas.in:
        * gnome-screenshot.c: Add an 'include pointer' option.