Ksnapshot: "Include mouse pointer" doesn't.

Bug #869652 reported by Ian Turner
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
KDE Graphics
Unknown
Medium
ksnapshot (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

STEPS TO REPRODUCE:
1. Press PrtSc key or run Ksnapshot
2. Check "Include Mouse Pointer" checkbox
3. Click "Take a New Snapshot"

EXPECTED BEHAVIOR:
New snapshot includes the mouse pointer.

ACTUAL BEHAVIOR:
Snapshot captures everything except the mouse pointer.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: ksnapshot 4:4.7.1-0ubuntu2
ProcVersionSignature: Ubuntu 3.0.0-12.19-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
ApportVersion: 1.23-0ubuntu2
Architecture: amd64
Date: Thu Oct 6 22:50:30 2011
InstallationMedia: Kubuntu 11.10 "Oneiric Ocelot" - Beta amd64 (20110901)
ProcEnviron:
 LANGUAGE=
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: ksnapshot
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
In , Yohng (yohng) wrote :

(*** This bug was imported into bugs.kde.org ***)

Package: ksnapshot
Version: unknown (using KDE 2.1.1 )
Severity: wishlist
Installed from: SuSE
Compiler: gcc version 2.95.2 19991024 (release)
OS: Linux 2.2.16 i686
OS/Compiler notes:

In ksnapshot program I would like to see checkbox "Grab with mouse cursor". That means that program should get cursor shape and lay it over bitmap as most of recent videocards do cursor in hardware and will not allow to grab it directly from screen.

Feature is very useful for taking screenshots for bug reports ;)

(Submitted via bugs.kde.org)
(Called from KBugReport dialog)

Revision history for this message
In , Akfy-rich-nw2w (akfy-rich-nw2w) wrote :

Not possible I'm afraid.

Rich.

Revision history for this message
In , Sébastien Laoût (slaout) wrote :

And now ?
Is it possible ?

KDE now knowjow to change cursor theme.
So,get theme couldbe possible.
If not,juste get the cursor position and include a generic cursor : it can be usefull,even if wrong cursor shape.

Revision history for this message
In , Jttac (jttac) wrote :

Wish to include or exclude mouse cursor when taking screen shot.
For example, include "paint bucket" cursor in graphic object for OpenOffice.org DRAW documentation.

Alternative would be some "clip art" feature somewhere in KDE so that I could copy an image of some particular mouse cursor shape (such as the paint bucket shape) and overlay the clip art onto my ksnapshot image.
Found all sorts of mouse cursor shapes, but no paint bucket. Oi. :-(

Revision history for this message
In , richlv (rich-hq) wrote :

this would be an extremly useful feature for bugreports. unfortunately it is not possible to vote anymore :/

and, for example, on windows foto canvas (acd software product) allows to grab with mouse pointer, so there must be some way to do this technically

Revision history for this message
In , Awendt-t (awendt-t) wrote :

Created attachment 10637
Allows ksnapshot to take screenshots that include the mouse pointer

I created a patch that adds this feature to ksnapshot. It relies on the XFIXES
extension. It adds a new checkbox that allows you to turn the feature on and
off, and a couple DCOP functions to get and set the state of the checkbox.

It also adds DCOP functions to get and set the state of the "include
decorations" checkbox, since I didn't see existing ones. And it fixes a couple
of variables that could have been used before they were initialized.

Revision history for this message
In , Janet (bugzilla-kerridis) wrote :

This patch never made it into ksnapshot, didn't it? In ksnaphot of KDE 3.5.1 there still is no checkbox option to include the mouse pointer. Maybe this bug report and Bug 100926 should go together.

Revision history for this message
In , Richard Moore (rich-kde) wrote :

*** Bug 100926 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Psychonaut (psychonaut) wrote :

Still no checkbox option to include the mouse pointer in KDE 3.5.5. Does this bug need to be reopened?

Revision history for this message
In , Richard Moore (rich-kde) wrote :

I don't understand how this got closed. It wasn't through the main bugzilla, reopenning. Aaron, any thoughts on how we can integrate this into the UI without screwing it up?

Revision history for this message
In , aseigo (aseigo) wrote :

perhaps take the "include window decorations" checkbox and do sth like:

Include: [ ] Window borders
         [ ] Mouse cursor

it shouldn't mess things up too much, i suppose. i don't understand why the patch provided disables the mouse cursor in region mode, however.

also, i wonder if the de-premultiplying is needed in qt4 (this would have to go into trunk, too late for 3.x, obviously). that would make the code a lot nicer =)

adding the ability to turn these things on/off using d-bus is a nice touch, though. =)

Revision history for this message
In , Awendt-t (awendt-t) wrote :

Region mode stops and waits for you to draw a rectangle with the mouse, so at the moment that KSnapshot grabs the screen contents, the mouse cursor would always be positioned at the very corner of the rectangle you just drew. KSnapshot also changes the cursor to a crosshair while you're doing this. That's why the patch disables the mouse cursor grabbing when in region mode.

I don't know how you'd make them compatible... stop and wait for a subsequent mouse click inside the rectangle you just drew?

Revision history for this message
In , aseigo (aseigo) wrote :

how about capturing the mouse cursor at the moment the screen capture is made and blit the cursor image onto the screen capture? then the user can select the desired region.

Revision history for this message
In , Awendt-t (awendt-t) wrote :

I suppose that'd be a good way to do it. The "snapshot delay" is currently disabled in region mode also, though, so there's no chance to move the mouse to the correct spot before the screenshot is acquired.

Revision history for this message
In , Janet (bugzilla-kerridis) wrote :

*** This bug has been confirmed by popular vote. ***

Revision history for this message
In , Richih-kde (richih-kde) wrote :

Any updates on this?

I would bump the version to 0.8.1, but that is not an option I can choose, at the moment.

Revision history for this message
In , Psychonaut (psychonaut) wrote :

The screenshot plugin for GIMP 2.6, which was released today, now includes the option to capture the mouse pointer. According to the release notes at <http://gimp.org/release-notes/gimp-2.6.html>, it uses XFixes. This is the same extension used by <email address hidden>'s patch. Any chance of getting this patch applied to the main development branch?

Revision history for this message
In , Kde-2011-08 (kde-2011-08) wrote :

With KDE 4 is this possible now?

Revision history for this message
In , Richard Moore (rich-kde) wrote :

Yes, this is now possible thanks to improvements to the X server (specifcally the XFixes extension). It will get implemented, however I haven't had time to look into it yet.

Revision history for this message
In , Pino Toscano (pinotree) wrote :

*** Bug 184287 has been marked as a duplicate of this bug. ***

Revision history for this message
In , JohnFlux (johnflux) wrote :

Can we get these patches committed?

Revision history for this message
In , JohnFlux (johnflux) wrote :

Created attachment 39791
Updated patch to add the cursor

This patch updates the previous one to port it to Qt4, cmake, etc. Also adds support for window section mode. It also fixes a bug with ksnapshot when selecting the last option in ksnapshot.

Revision history for this message
In , Pino Toscano (pinotree) wrote :

Created attachment 39792
Another implementation

Sorry for the delay; this is patch it's been sitting locally for a couple of months, and forgot to send it to Richmoore earlier (done that a couple of days ago).

Different implementation, not based on the previous patches here.

Revision history for this message
In , JohnFlux (johnflux) wrote :

Cool. My patch has the advantages:

1) Disables/enables the checkbox depending on whether the mode supports it or not
2) Supports the Window Section mode
3) Loads the cursor straight into a ARGB32_Premultiplied

Revision history for this message
In , JohnFlux (johnflux) wrote :

4) Saves/Loads the value

Revision history for this message
In , JohnFlux (johnflux) wrote :

Created attachment 39797
Updated for 64bit

This updates the code to work (untested) on 64bit, based on pinotree's code.

Revision history for this message
In , Pino Toscano (pinotree) wrote :

Created attachment 39799
Fixed implementation of mine

This works on both 32bit and 64 bit (tested), saves the option value and what not.

Revision history for this message
In , JohnFlux (johnflux) wrote :

I committed the fix I mentioned before when selecting the Current Screen.

Revision history for this message
In , JohnFlux (johnflux) wrote :

The two patches are becoming more and more similar now.

I think the only changes now are:

1) I enabled/disable the gui option when you change modes
2) I support the window section mode

Revision history for this message
In , JohnFlux (johnflux) wrote :

For multiple cursor support we need to:

1) Use XIQueryDevice(XIAllMasterDevices) and find all the devices that are XIMasterPointer
2) Remember the current XGetClientPointer(dpy)
2) For each one found, do XSetClientPointer(dpy, pointer, None)
3) Now when we do XFixesGetCursorImage(dpy) we will get the image of the current cursor
4) XSetClientPointer the cursor back to the original one

Revision history for this message
In , Christoph-maxiom (christoph-maxiom) wrote :

*** Bug 241472 has been marked as a duplicate of this bug. ***

Revision history for this message
In , ThorbjørnTux (martsummsw) wrote :

Created attachment 47953
to get mouse cursor

Revision history for this message
In , ThorbjørnTux (martsummsw) wrote :

#31 is a patch

Just to state what I wrote in Bug 241472

The code is heavily inspired by
http://msnkambule.wordpress.com/2010/04/09/capturing-a-screenshot-showing-mouse-cursor-in-kde/
Thanks to Mayibongwe Nkambule.

/Thorbjørn

Revision history for this message
In , ThorbjørnTux (martsummsw) wrote :

Could somebody please test - and probably merge my patch into trunk?

Revision history for this message
In , ThorbjørnTux (martsummsw) wrote :

Sorry, I am stupid enough not to read the whole thread.
Did not notice that serveral patches was made. Maybe somebody could include just one patch.

PS: My patch does not support multiply cursors.

Revision history for this message
In , Hans-maulwurf (hans-maulwurf) wrote :

I have some weird rendering glitches with your patch. I applied it to ksnapshot 4.4.4. Screenshot: http://chaox.net/~jens/test1.png

Revision history for this message
In , aseigo (aseigo) wrote :

i've merged John's patch with some modifications (in part to make it apply cleanly against trunk, in part to alter the strings and some of the logic) and also added code to remove the "Current Screen" option when there is only one screen on the system. i will commit once 4.6 is open since we are currently in string freeze and this change contains a new string.

i will credit both John and tmartsum in the commit message. cheers!

@Jens: when you say "your patch", do you mean tmartsum's or John's?

Revision history for this message
In , ThorbjørnTux (martsummsw) wrote :

#36
Thanks a lot for patching trunk. I will look into the code.

#35
It is probably against my patch, but I haven't seen anything similar. Does it happen all the time? (Both from ksnapshot and PrtSc), Nevertheless you can test against trunk now, but I doubt there are that many ways to grab the cursor - and John patch probably works in a similar way.

I use:
XFixesCursorImage *xfcursorImage = XFixesGetCursorImage( QX11Info::display());
QImage mouseCursor( (uchar*)xfcursorImage->pixels,xfcursorImage->width, xfcursorImage->height, QImage::Format_ARGB32_Premultiplied );

Could it be that this only happens if you press PrtSc or does it happen from knsapshot itself? I had some problems *not* getting a waiting cursor when ksnapshot was loading (on PrtSc) - and I wonder if this could be a timing issue. (Meaning happening when PrtSc was pressed and when mouse-cursor was changing back to normal cursor pointer. Meaning that the *xfcursorImage is getting invalid.)

Revision history for this message
In , ThorbjørnTux (martsummsw) wrote :

Ok - misunderstood. Can you inform when the code is in trunk - then I like to test it.

Revision history for this message
In , Anselmo-melo (anselmo-melo) wrote :

*** Bug 237941 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Christoph-maxiom (christoph-maxiom) wrote :

The code is in trunk, please test.

Revision history for this message
In , ThorbjørnTux (martsummsw) wrote :

It DID work at some point, but currently I can *not* get it to work right.
(On start no mouse-cursor (or did I see it one time) on delayed snapshots no mouse cursor ...)

Revision history for this message
In , Janjabber (janjabber) wrote :

It seems to work fine here, with 4.6 beta 2, under Archlinux.
Video chipset Intel 855GM with intel driver v2.13.0, in case that matters.

It works on the first snapshot and the ones after that, with and without desktop effects.

Revision history for this message
In , Janet (bugzilla-kerridis) wrote :

I've just tested with 4.6 beta 2 and Kubuntu, does work very well. BTW: I like the new layout of ksnapshot a lot!

Revision history for this message
In , slashdevdsp (slashdevdsp) wrote :

kubuntu 10.10 with kde 4.6 RC 1, enabling the Include mouse pointer, does not work, I have:

Capture mode: window under cursor
snapshot delay: 2 seconds

And the window I am capturing is:
dolphin->places->network->add network folder wizard->select secure shell (ssh) and click next, press 'take a snap shot' and mouse over any of the fields or the text 'save & connect' button in the network folder wizard and the resulting image does not have the mouse pointer.

Revision history for this message
In , Janet (bugzilla-kerridis) wrote :

I can confirm that. It did work with Beta2 but doesn't work anymore with RC1. No matter which settings, first start or not, delay or not, region, window, fullscreen.

Revision history for this message
In , BajK (kaiuwebroulik2) wrote :

It seems to work when using “Window under mouse pointer” but no longer when doing a fullscreen shot.

Revision history for this message
In , BajK (kaiuwebroulik2) wrote :

It seems to work with fullscreen shot but NOT when using a Screenshot delay.

Revision history for this message
In , Markus-elfring (markus-elfring) wrote :

The mouse pointer is not included in my screen shots by the tool "KSnapshot 0.8.2" (KDE 4.6.0) that is running on my openSUSE 11.4 system if I select the modes "full screen" or "area in a window".

Revision history for this message
In , Victor (blindvic) wrote :

The same here. Sometimes mouse pointer is included in the screenshot. Sometimes not. Cannot figure out the circumstances when it works or doesn't.

Revision history for this message
In , Nicolas Réau (kolia) wrote :

With Ksnapshot 0.8.2 and KDE 4.7.1 the behavior of the "include mouse cursor" is still chaotic. It works sometimes, and sometimes not. Today, I can get the cursor when taking the screenshot on a Firefox window, but i don't get the cursor if I'm over a Digikam window :)

Revision history for this message
Ian Turner (vectro) wrote :
Revision history for this message
David Wonderly (david.wonderly) wrote :

I can confirm this bug. The pointer does not show up when it is selected.

Changed in ksnapshot (Ubuntu):
status: New → Confirmed
Revision history for this message
David Wonderly (david.wonderly) wrote :

I found this bug upstream and have connected it.

Cheers!

Changed in kdegraphics:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , szotsaki (szotsaki) wrote :

This bug is still present in KDE 4.9.1.
When you choose „Full screen” and check the mouse cursor check box, KSnapshot doesn't draw the cursor to the resulting image.

Revision history for this message
In , Kde-2011-08 (kde-2011-08) wrote :

Happy decade, bug!

Changed in kdegraphics:
status: Confirmed → Unknown
Revision history for this message
In , Γεώργιος Γεωργάς (apopas) wrote :

I confirm this bug in KDE 4.9.5 and fullscreen selection.

Revision history for this message
In , Jenya-- (jenya--) wrote :

I can confirm it with Chakra Linux + KDE 4.10 with latest nvidia drivers.

Revision history for this message
In , Elvenfighter-i (elvenfighter-i) wrote :

Created attachment 80358
Cursor, capruted on screenshot (made with ksnapshot)

With update to KDE 4.10.4 I can capture my cursor on snapshots, made with KSnapshot. I'm using:
* Kubuntu 13.04 x86_64
* KDE 4.10.4
* Xorg 1.13.3

Revision history for this message
In , Ian Turner (vectro) wrote :

This is fixed for me also on 10.4.2.

Revision history for this message
In , aseigo (aseigo) wrote :

I get the feeling that this may be related to X versions and drivers. Here with Intel drivers and Xorg 7.6 tings are not as happy: I get mouse cursors in window shots, but not full screen. Will require some sleuthing in the code to see what is going wrong with the cursor grabbing.

Revision history for this message
In , Ian Turner (vectro) wrote :

FWIW I get the cursor with both window shots and full screen.

I have X.Org X Server 1.11.3 running intel_drv.so 2.17.0.
Hardware is Sandybridge Mobile (GT2). There is an nvidia Optimus chip also, but I think it is disabled.

Revision history for this message
Harald Sitter (apachelogger) wrote :

 Hi there!

Thanks for reporting this bug! Your bug seems to be a problem with the KDE program itself, and not with our KDE packages. While we appreciate your issue, it would be better if it was tracked at https://bugs.kde.org, so that the KDE developers can deal with this speedily and have direct communication with you as the reporter for more effective debugging.

Thanks!

Changed in ksnapshot (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
In , Andrew-crouthamel (andrew-crouthamel) wrote :

Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years and I will be closing this bug. Spectacle is the replacement for ksnapshot now. Please test again and file a new bug for Spectacle if you still have issues. Thank you!

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.