Merge commit '5b9c817dc7577b6d44acc94d73b9c77c52cda489'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 5 Oct 2014 01:22:55 +0000 (03:22 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 5 Oct 2014 01:22:55 +0000 (03:22 +0200)
* commit '5b9c817dc7577b6d44acc94d73b9c77c52cda489':
  x11grab: Check XFixesGetCursorImage return value

Conflicts:
libavdevice/x11grab.c

See: a65c0a3fe822386be30fd3371af9f0d008b02874

The warning with adjusted text is kept from a65c0a3fe822386be30fd3371af9f0d008b02874
but drawing the cursor is not disabled in case XFixesGetCursorImage() fails

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavdevice/x11grab.c

@@@ -423,18 -391,9 +423,17 @@@ static void paint_mouse_pointer(XImage 
      if (image->bits_per_pixel != 24 && image->bits_per_pixel != 32)
          return;
  
 +    if (!s->c)
 +        s->c = XCreateFontCursor(dpy, XC_left_ptr);
 +    attr.cursor = s->c;
 +    XChangeWindowAttributes(dpy, root, CWCursor, &attr);
 +
      xcim = XFixesGetCursorImage(dpy);
 -    if (!xcim)
 +    if (!xcim) {
 +        av_log(s1, AV_LOG_WARNING,
-                "XFixes extension not available, impossible to draw cursor\n");
-         s->draw_mouse = 0;
++               "XFixesGetCursorImage failed\n");
          return;
 +    }
  
      x = xcim->x - xcim->xhot;
      y = xcim->y - xcim->yhot;