From df2c805b22933ed4e3d1ea68c9f5cf497b0447ab Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Thu, 13 Oct 2011 12:27:09 +0100 Subject: [PATCH] Add support for hiding/showing cursors per-sprite Signed-off-by: Daniel Stone --- configure.ac | 2 +- include/X11/extensions/Xfixes.h | 11 +++++++++++ src/Cursor.c | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index fc8c1e1..01b3af4 100644 --- a/configure.ac +++ b/configure.ac @@ -32,7 +32,7 @@ AC_PREREQ([2.60]) # that 'revision' number appears in Xfixes.h and has to be manually # synchronized. # -AC_INIT(libXfixes, [5.0], +AC_INIT(libXfixes, [6.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXfixes]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) diff --git a/include/X11/extensions/Xfixes.h b/include/X11/extensions/Xfixes.h index 8995d14..486522c 100644 --- a/include/X11/extensions/Xfixes.h +++ b/include/X11/extensions/Xfixes.h @@ -264,6 +264,17 @@ XFixesDestroyPointerBarrier(Display *dpy, PointerBarrier b); #endif /* XFIXES_MAJOR >= 5 */ +#if XFIXES_MAJOR >= 6 +/* Version 6.0 externs */ + +void +XFixesHideDeviceCursor (Display *dpy, Window win, CARD16 device); + +void +XFixesShowDeviceCursor (Display *dpy, Window win, CARD16 device); + +#endif /* XFIXES_MAJOR >= 6 */ + _XFUNCPROTOEND #endif /* _XFIXES_H_ */ diff --git a/src/Cursor.c b/src/Cursor.c index b3dfed1..51bc5d7 100644 --- a/src/Cursor.c +++ b/src/Cursor.c @@ -276,6 +276,44 @@ XFixesShowCursor (Display *dpy, Window win) SyncHandle (); } +void +XFixesHideDeviceCursor (Display *dpy, Window win, CARD16 device) +{ + XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); + xXFixesHideDeviceCursorReq *req; + + XFixesSimpleCheckExtension (dpy, info); + if (info->major_version < 4) + return; + LockDisplay (dpy); + GetReq (XFixesHideDeviceCursor, req); + req->reqType = info->codes->major_opcode; + req->xfixesReqType = X_XFixesHideCursor; + req->window = win; + req->device = device; + UnlockDisplay (dpy); + SyncHandle (); +} + +void +XFixesShowDeviceCursor (Display *dpy, Window win, CARD16 device) +{ + XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); + xXFixesShowDeviceCursorReq *req; + + XFixesSimpleCheckExtension (dpy, info); + if (info->major_version < 4) + return; + LockDisplay (dpy); + GetReq (XFixesShowDeviceCursor, req); + req->reqType = info->codes->major_opcode; + req->xfixesReqType = X_XFixesShowCursor; + req->window = win; + req->device = device; + UnlockDisplay (dpy); + SyncHandle (); +} + PointerBarrier XFixesCreatePointerBarrier(Display *dpy, Window w, int x1, int y1, int x2, int y2, int directions, -- 1.7.7