[FFmpeg-cvslog] x11: Fix x11grab BadCursor

Isaac Dooley git at videolan.org
Tue Oct 23 21:49:39 CEST 2012


ffmpeg | branch: master | Isaac Dooley <ffmpeg at isaacdooley.com> | Tue Oct 23 21:39:56 2012 +0200| [469a65b1502505cb8f46938b1b316e4c17a2f2a0] | committer: Michael Niedermayer

x11: Fix x11grab BadCursor

Fixes Ticket1738

Based-on: A fix found in a perl module (http://ffmpeg.org/pipermail/ffmpeg-user/2012-August/008804.html)
Reviewed-by: Clemens Fruhwirth <clemens at endorphin.org>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=469a65b1502505cb8f46938b1b316e4c17a2f2a0
---

 libavdevice/x11grab.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index 91c62d9..4dddceb 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -43,6 +43,7 @@
 #include "libavutil/parseutils.h"
 #include "libavutil/time.h"
 #include <time.h>
+#include <X11/cursorfont.h>
 #include <X11/X.h>
 #include <X11/Xlib.h>
 #include <X11/Xlibint.h>
@@ -357,6 +358,12 @@ paint_mouse_pointer(XImage *image, struct x11grab *s)
     if (image->bits_per_pixel != 24 && image->bits_per_pixel != 32)
         return;
 
+    Cursor c = XCreateFontCursor(dpy, XC_left_ptr);
+    Window w = DefaultRootWindow(dpy);
+    XSetWindowAttributes attr;
+    attr.cursor = c;
+    XChangeWindowAttributes(dpy, w, CWCursor, &attr);
+
     xcim = XFixesGetCursorImage(dpy);
 
     x = xcim->x - xcim->xhot;



More information about the ffmpeg-cvslog mailing list