[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libx11: Changes to 'upstream-experimental'



 .gitignore                            |   55 
 Makefile.am                           |    4 
 README                                |   77 
 acinclude.m4                          |    2 
 configure.ac                          |   42 
 cpprules.in                           |    4 
 include/.gitignore                    |    2 
 include/X11/.gitignore                |    2 
 include/X11/Xlib-xcb.h                |    5 
 include/X11/Xlib.h                    |   44 
 include/X11/Xlibint.h                 |   74 
 include/X11/cursorfont.h              |    5 
 man/.gitignore                        |    3 
 man/Makefile.am                       |    9 
 man/XAllocColor.man                   |    2 
 man/XCreateColormap.man               |    2 
 man/XCreateFontCursor.man             |    2 
 man/XGetEventData.man                 |  223 +
 man/XReadBitmapFile.man               |    2 
 man/xkb/XkbGetKeyboard.man            |    2 
 man/xkb/XkbSAGroup.man                |    1 
 man/xkb/XkbSASetGroup.man             |    1 
 man/xkb/XkbSetIndicatorMap.man        |    3 
 modules/.gitignore                    |    2 
 modules/im/.gitignore                 |    2 
 modules/im/ximcp/.gitignore           |    7 
 modules/im/ximcp/imDefLkup.c          |   11 
 modules/im/ximcp/imDispch.c           |    6 
 modules/im/ximcp/imInsClbk.c          |    3 
 modules/im/ximcp/imInt.c              |   11 
 modules/im/ximcp/imLcFlt.c            |    8 
 modules/im/ximcp/imLcGIc.c            |    4 
 modules/im/ximcp/imLcIm.c             |    3 
 modules/im/ximcp/imLcLkup.c           |   54 
 modules/im/ximcp/imLcPrs.c            |    2 
 modules/im/ximcp/imLcSIc.c            |    4 
 modules/im/ximcp/imRm.c               |   30 
 modules/im/ximcp/imThaiFlt.c          |   56 
 modules/im/ximcp/imThaiIm.c           |   12 
 modules/im/ximcp/imTrX.c              |    7 
 modules/im/ximcp/imTransR.c           |   23 
 modules/lc/.gitignore                 |    2 
 modules/lc/Utf8/.gitignore            |    7 
 modules/lc/Utf8/lcUTF8Load.c          |   14 
 modules/lc/def/.gitignore             |    7 
 modules/lc/def/lcDefConv.c            |    2 
 modules/lc/gen/.gitignore             |    7 
 modules/lc/gen/lcGenConv.c            |    2 
 modules/lc/xlocale/.gitignore         |    7 
 modules/lc/xlocale/lcJis.c            |    2 
 modules/om/.gitignore                 |    2 
 modules/om/generic/.gitignore         |    7 
 modules/om/generic/omGeneric.c        |    2 
 nls/.gitignore                        |   11 
 nls/C/.gitignore                      |    4 
 nls/Makefile.am                       |    2 
 nls/am_ET.UTF-8/.gitignore            |    4 
 nls/armscii-8/.gitignore              |    4 
 nls/compose.dir.pre                   |   30 
 nls/el_GR.UTF-8/.gitignore            |    4 
 nls/el_GR.UTF-8/Compose.pre           |  433 --
 nls/en_US.UTF-8/.gitignore            |    4 
 nls/en_US.UTF-8/Compose.pre           | 2078 ++---------
 nls/en_US.UTF-8/XLC_LOCALE.pre        |  198 -
 nls/fi_FI.UTF-8/Compose.pre           | 5156 ++++++++++++++++++++++++++++
 nls/fi_FI.UTF-8/Makefile.am           |    3 
 nls/georgian-academy/.gitignore       |    4 
 nls/georgian-ps/.gitignore            |    4 
 nls/ibm-cp1133/.gitignore             |    4 
 nls/iscii-dev/.gitignore              |    4 
 nls/isiri-3342/.gitignore             |    4 
 nls/iso8859-1/.gitignore              |    4 
 nls/iso8859-10/.gitignore             |    4 
 nls/iso8859-11/.gitignore             |    4 
 nls/iso8859-13/.gitignore             |    4 
 nls/iso8859-14/.gitignore             |    4 
 nls/iso8859-15/.gitignore             |    4 
 nls/iso8859-2/.gitignore              |    4 
 nls/iso8859-3/.gitignore              |    4 
 nls/iso8859-4/.gitignore              |    4 
 nls/iso8859-5/.gitignore              |    4 
 nls/iso8859-6/.gitignore              |    4 
 nls/iso8859-7/.gitignore              |    4 
 nls/iso8859-8/.gitignore              |    4 
 nls/iso8859-9/.gitignore              |    4 
 nls/iso8859-9e/.gitignore             |    4 
 nls/ja.JIS/.gitignore                 |    4 
 nls/ja.S90/.gitignore                 |    4 
 nls/ja.SJIS/.gitignore                |    4 
 nls/ja.U90/.gitignore                 |    4 
 nls/ja/.gitignore                     |    4 
 nls/ja_JP.UTF-8/.gitignore            |    4 
 nls/ko/.gitignore                     |    4 
 nls/ko_KR.UTF-8/.gitignore            |    4 
 nls/koi8-c/.gitignore                 |    4 
 nls/koi8-r/.gitignore                 |    4 
 nls/koi8-u/.gitignore                 |    4 
 nls/locale.alias.pre                  |  136 
 nls/locale.dir.pre                    |   25 
 nls/microsoft-cp1251/.gitignore       |    4 
 nls/microsoft-cp1255/.gitignore       |    4 
 nls/microsoft-cp1256/.gitignore       |    4 
 nls/mulelao-1/.gitignore              |    4 
 nls/nokhchi-1/.gitignore              |    4 
 nls/pt_BR.UTF-8/.gitignore            |    4 
 nls/pt_BR.UTF-8/Compose.pre           | 1487 --------
 nls/ru_RU.UTF-8/Compose.pre           |    1 
 nls/ru_RU.UTF-8/Makefile.am           |    3 
 nls/ru_RU.UTF-8/XI18N_OBJS            |    7 
 nls/ru_RU.UTF-8/XLC_LOCALE.pre        |  169 
 nls/tatar-cyr/.gitignore              |    4 
 nls/th_TH.UTF-8/.gitignore            |    4 
 nls/th_TH.UTF-8/XLC_LOCALE.pre        |   12 
 nls/th_TH/.gitignore                  |    4 
 nls/th_TH/XLC_LOCALE.pre              |    6 
 nls/tscii-0/.gitignore                |    4 
 nls/vi_VN.tcvn/.gitignore             |    4 
 nls/vi_VN.viscii/.gitignore           |    4 
 nls/zh_CN.UTF-8/.gitignore            |    4 
 nls/zh_CN.gb18030/.gitignore          |    4 
 nls/zh_CN.gbk/.gitignore              |    4 
 nls/zh_CN/.gitignore                  |    4 
 nls/zh_HK.UTF-8/.gitignore            |    4 
 nls/zh_HK.big5/.gitignore             |    4 
 nls/zh_HK.big5hkscs/.gitignore        |    4 
 nls/zh_TW.UTF-8/.gitignore            |    4 
 nls/zh_TW.big5/.gitignore             |    4 
 nls/zh_TW/.gitignore                  |    4 
 src/.gitignore                        |   12 
 src/ChkIfEv.c                         |    1 
 src/ChkMaskEv.c                       |    6 
 src/ChkTypEv.c                        |    4 
 src/ChkTypWEv.c                       |    4 
 src/ChkWinEv.c                        |    6 
 src/ConnDis.c                         |    7 
 src/Context.c                         |   11 
 src/CrGlCur.c                         |    4 
 src/ErrDes.c                          |    2 
 src/FreeEventData.c                   |   42 
 src/GetEventData.c                    |   42 
 src/Host.c                            |   24 
 src/IfEvent.c                         |    1 
 src/ImUtil.c                          |    2 
 src/InitExt.c                         |   43 
 src/Makefile.am                       |    5 
 src/MaskEvent.c                       |    6 
 src/NextEvent.c                       |    4 
 src/OpenDis.c                         |   22 
 src/ParseGeom.c                       |   18 
 src/PeekEvent.c                       |    5 
 src/PeekIfEv.c                        |    5 
 src/PutBEvent.c                       |   18 
 src/Region.c                          |  146 
 src/StBytes.c                         |    2 
 src/WinEvent.c                        |    6 
 src/XErrorDB                          |   58 
 src/XKeysymDB                         |    2 
 src/XlibInt.c                         |  208 +
 src/Xrm.c                             |   14 
 src/locking.c                         |  109 
 src/util/.gitignore                   |    4 
 src/util/makekeys.c                   |   26 
 src/utlist.h                          |  116 
 src/x11_trans.c                       |    4 
 src/xcb_disp.c                        |   16 
 src/xcb_io.c                          |   26 
 src/xcms/.gitignore                   |    7 
 src/xkb/.gitignore                    |    7 
 src/xkb/XKBBind.c                     |    2 
 src/xkb/XKBMisc.c                     |    2 
 src/xlibi18n/.gitignore               |    7 
 src/xlibi18n/ICWrap.c                 |   48 
 src/xlibi18n/IMWrap.c                 |   24 
 src/xlibi18n/Makefile.am              |    2 
 src/xlibi18n/XimTrans.h               |    6 
 src/xlibi18n/Ximint.h                 |    8 
 src/xlibi18n/Xlcint.h                 |    5 
 src/xlibi18n/imKStoUCS.c              |    4 
 src/xlibi18n/lcCT.c                   |    4 
 src/xlibi18n/lcFile.c                 |   22 
 src/xlibi18n/lcGeneric.c              |    3 
 src/xlibi18n/lcInit.c                 |    4 
 src/xlibi18n/lcUTF8.c                 |  552 ++-
 src/xlibi18n/lcUniConv/big5hkscs.h    | 6252 ++++++++++++++++++++++++++++++++++
 src/xlibi18n/lcUniConv/cjk_tab_to_h.c |   47 
 src/xlibi18n/lcUniConv/gbk.h          | 6200 +++++++++++++++++++++++++++++++++
 src/xlibi18n/lcUniConv/ksc5601.h      |   12 
 src/xlibi18n/lcWrap.c                 |    6 
 x11.pc.in                             |    2 
 189 files changed, 20543 insertions(+), 4575 deletions(-)

New commits:
commit 9da7e230d5320e1556ad2084fcd06ee7994385ea
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Aug 5 14:15:02 2009 +1000

    Bump to 1.2.99.901 (1.3 RC1)
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/configure.ac b/configure.ac
index 265b86b..45e9d74 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
 
 AC_PREREQ(2.60)
 AC_INIT([libX11],
-        1.2.99.1,
+        1.2.99.901,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         libX11)
 AC_CONFIG_SRCDIR([Makefile.am])

commit 8f78c7b4e3570cd46c5a220982963c17fe2157b8
Author: Filippo Giunchedi <filippo@debian.org>
Date:   Sat Jun 6 16:56:54 2009 +0200

    nls: add {left,right}wards arrow to compose table
    
    Debian bug#532117 <http://bugs.debian.org/532117>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/nls/en_US.UTF-8/Compose.pre b/nls/en_US.UTF-8/Compose.pre
index 26084b9..a4174bb 100644
--- a/nls/en_US.UTF-8/Compose.pre
+++ b/nls/en_US.UTF-8/Compose.pre
@@ -4150,6 +4150,8 @@ XCOMM Part 3
 <Multi_key> <KP_Divide> <rightarrow> 	: "↛"   U219B # RIGHTWARDS ARROW WITH STROKE
 <Multi_key> <slash> <U2194>  	: "↮"   U21AE # LEFT RIGHT ARROW WITH STROKE
 <Multi_key> <KP_Divide> <U2194> 	: "↮"   U21AE # LEFT RIGHT ARROW WITH STROKE
+<Multi_key> <less> <minus> 	: "←" U2190 # LEFTWARDS ARROW
+<Multi_key> <minus> <greater> 	: "→" U2192 # RIGHTWARDS ARROW
 <Multi_key> <U2203> <U0338> 	: "∄"   U2204 # THERE DOES NOT EXIST
 <Multi_key> <U2208> <U0338> 	: "∉"   U2209 # NOT AN ELEMENT OF
 <Multi_key> <U220B> <U0338> 	: "∌"   U220C # DOES NOT CONTAIN AS MEMBER

commit 7949bfa00390241d994f32463e50d4bd78920568
Author: Julien Cristau <jcristau@debian.org>
Date:   Fri Jul 31 13:33:52 2009 +0200

    Update library version for new symbols
    
    Commit 554f755e5545f63d3c8f299297927238da155773 added generic event
    cookie handling.  Bump libX11 version number accordingly.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/Makefile.am b/src/Makefile.am
index 774aa5a..26d8e27 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -376,7 +376,7 @@ if XKB
 USE_XKB_LIBS = $(XKB_LIBS)
 endif
 
-libX11_la_LDFLAGS = -version-number 6:2:0 -no-undefined
+libX11_la_LDFLAGS = -version-number 6:3:0 -no-undefined
 
 libX11_la_LIBADD = \
 	$(USE_I18N_LIBS) \

commit 640fec5f4feacd01a00eea3dcd4edb220907d3dc
Author: Julien Cristau <jcristau@debian.org>
Date:   Sun Aug 2 17:18:31 2009 +0200

    Add _XFUNCPROTOBEGIN/END to Xlib-xcb.h
    
    X.Org bug#22252 <https://bugs.freedesktop.org/show_bug.cgi?id=22252>
    
    Reported-by: Riku Salminen <rsalmin2@cc.hut.fi>
    Signed-off-by: Julien Cristau <jcristau@debian.org>

diff --git a/include/X11/Xlib-xcb.h b/include/X11/Xlib-xcb.h
index b88e2e7..03d8f98 100644
--- a/include/X11/Xlib-xcb.h
+++ b/include/X11/Xlib-xcb.h
@@ -6,10 +6,15 @@
 
 #include <xcb/xcb.h>
 #include <X11/Xlib.h>
+#include <X11/Xfuncproto.h>
+
+_XFUNCPROTOBEGIN
 
 xcb_connection_t *XGetXCBConnection(Display *dpy);
 
 enum XEventQueueOwner { XlibOwnsEventQueue = 0, XCBOwnsEventQueue };
 void XSetEventQueueOwner(Display *dpy, enum XEventQueueOwner owner);
 
+_XFUNCPROTOEND
+
 #endif /* XLIB_XCB_H */

commit bc06d49e9dac1836d6824769ddb2ac5ba9f14df7
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Jul 29 08:44:09 2009 +1000

    Fix compiler warning 'unused variable qelt'
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/XlibInt.c b/src/XlibInt.c
index 74cc322..9505b3f 100644
--- a/src/XlibInt.c
+++ b/src/XlibInt.c
@@ -2340,7 +2340,6 @@ Bool
 _XFetchEventCookie(Display *dpy, XGenericEventCookie* ev)
 {
     Bool ret = False;
-    _XQEvent *qelt;
     struct stored_event **head, *event;
     head = (struct stored_event**)&dpy->cookiejar;
 

commit 03f4907e14f5755e72309f08742977b871e81e33
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Jul 29 08:34:57 2009 +1000

    Add utlist.h to the Makefile.am
    
    utlist.h contains the linked list macros, it was added with the recent
    addition of event cookies but utlist.h wasn't added to the Makefile.am. As a
    result, make dist failed.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/Makefile.am b/src/Makefile.am
index 958d542..774aa5a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -299,6 +299,7 @@ libX11_la_SOURCES = \
                   UnldFont.c \
                   UnmapSubs.c \
                   UnmapWin.c \
+                  utlist.h \
                   VisUtil.c \
                   WarpPtr.c \
                   Window.c \

commit 554f755e5545f63d3c8f299297927238da155773
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jun 26 11:27:43 2009 +1000

    Add generic event cookie handling to libX11.
    
    Generic events require more bytes than Xlib provides in the standard XEvent.
    Memory allocated by the extension and stored as pointers inside the event is
    prone to leak by simple 'while (1) { XNextEvent(...); }' loops.
    
    This patch adds cookie handling for generic events. Extensions may register
    a cookie handler in addition to the normal event vectors. If an extension
    has registered a cookie handler, _all_ generic events for this extensions
    must be handled through cookies. Otherwise, the default event handler is
    used.
    
    The cookie handler must return an XGenericEventCookie with a pointer to the
    data.The rest of the event (type, serialNumber, etc.) are to be filled as
    normal. When a client retrieves such a cookie event, the data is stored in
    an internal queue (the 'cookiejar'). This data is freed on the next call to
    XNextEvent().
    
    New extension interfaces:
        XESetWireToEventCookie(display, extension_number, cookie_handler)
    
    Where cookie_handler must set cookie->data. The data pointer is of arbitray
    size and type but must be a single memory block. This memory block
    represents the actual extension's event.
    
    New client interfaces:
        XGetEventData(display, *cookie);
        XFreeEventData(display, *cookie);
    
    If the client needs the actual event data, it must call XGetEventData() with
    the cookie. This returns the data pointer (and removes it from the cookie
    jar) and the client is then responsible for freeing the event with
    XFreeEventData(). It is safe to call either function with a non-cookie
    event. Events unclaimed or not handled by the XGetEventData() are cleaned up
    automatically.
    
    Example client code:
        XEvent event;
        XGenericEventCookie *cookie = &ev;
    
        XNextEvent(display, &event);
        if (XGetEventData(display, cookie)) {
            XIEvent *xievent = cookie->data;
            ...
        } else if (cookie->type == GenericEvent) {
            /* handle generic event */
        } else {
            /* handle extension/core event */
        }
        XFreeEventData(display, cookie);
    
    Cookies are not multi-threading safe. Clients that use XGetEventData() must
    lock between XNextEvent and XGetEventData to avoid other threads freeing
    cookies.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/include/X11/Xlib.h b/include/X11/Xlib.h
index 682988c..2c30bc0 100644
--- a/include/X11/Xlib.h
+++ b/include/X11/Xlib.h
@@ -966,6 +966,17 @@ typedef struct
     int            evtype;       /* actual event type. */
     } XGenericEvent;
 
+typedef struct {
+    int            type;         /* of event. Always GenericEvent */
+    unsigned long  serial;       /* # of last request processed */
+    Bool           send_event;   /* true if from SendEvent request */
+    Display        *display;     /* Display the event was read from */
+    int            extension;    /* major opcode of extension that caused the event */
+    int            evtype;       /* actual event type. */
+    unsigned int   cookie;
+    void           *data;
+} XGenericEventCookie;
+
 /*
  * this union is defined so Xlib can always use the same sized
  * event structure internally, to avoid memory fragmentation.
@@ -1003,6 +1014,8 @@ typedef union _XEvent {
 	XMappingEvent xmapping;
 	XErrorEvent xerror;
 	XKeymapEvent xkeymap;
+	XGenericEvent xgeneric;
+	XGenericEventCookie xcookie;
 	long pad[24];
 } XEvent;
 #endif
@@ -3998,6 +4011,16 @@ extern int _Xwctomb(
     wchar_t			/* wc */
 );
 
+extern Bool XGetEventData(
+    Display*			/* dpy */,
+    XGenericEventCookie*	/* cookie*/
+);
+
+extern void XFreeEventData(
+    Display*			/* dpy */,
+    XGenericEventCookie*	/* cookie*/
+);
+
 _XFUNCPROTOEND
 
 #endif /* _XLIB_H_ */
diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h
index 4f3755f..2acfc76 100644
--- a/include/X11/Xlibint.h
+++ b/include/X11/Xlibint.h
@@ -185,6 +185,20 @@ struct _XDisplay
 	struct _XkbInfoRec *xkb_info; /* XKB info */
 	struct _XtransConnInfo *trans_conn; /* transport connection object */
 	struct _X11XCBPrivate *xcb; /* XCB glue private data */
+
+	/* Generic event cookie handling */
+	unsigned int next_cookie; /* next event cookie */
+	/* vector for wire to generic event, index is (extension - 128) */
+	Bool (*generic_event_vec[128])(
+		Display *	/* dpy */,
+		XGenericEventCookie *	/* Xlib event */,
+		xEvent *	/* wire event */);
+	/* vector for event copy, index is (extension - 128) */
+	Bool (*generic_event_copy_vec[128])(
+		Display *	/* dpy */,
+		XGenericEventCookie *	/* in */,
+		XGenericEventCookie *   /* out*/);
+	void *cookiejar;  /* cookie events returned but not claimed */
 };
 
 #define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n)
@@ -1005,6 +1019,19 @@ extern Bool _XUnknownWireEvent(
     XEvent*	/* re */,
     xEvent*	/* event */
 );
+
+extern Bool _XUnknownWireEventCookie(
+    Display*	/* dpy */,
+    XGenericEventCookie*	/* re */,
+    xEvent*	/* event */
+);
+
+extern Bool _XUnknownCopyEventCookie(
+    Display*	/* dpy */,
+    XGenericEventCookie*	/* in */,
+    XGenericEventCookie*	/* out */
+);
+
 extern Status _XUnknownNativeEvent(
     Display*	/* dpy */,
     XEvent*	/* re */,
@@ -1157,6 +1184,31 @@ extern Bool (*XESetWireToEvent(
     Display*, XEvent*, xEvent*
 );
 
+extern Bool (*XESetWireToEventCookie(
+    Display*		/* display */,
+    int			/* extension */,
+    Bool (*) (
+	       Display*			/* display */,
+               XGenericEventCookie*	/* re */,
+               xEvent*			/* event */
+             )		/* proc */
+))(
+    Display*, XGenericEventCookie*, xEvent*
+);
+
+extern Bool (*XESetCopyEventCookie(
+    Display*		/* display */,
+    int			/* extension */,
+    Bool (*) (
+	       Display*			/* display */,
+               XGenericEventCookie*	/* in */,
+               XGenericEventCookie*	/* out */
+             )		/* proc */
+))(
+    Display*, XGenericEventCookie*, XGenericEventCookie*
+);
+
+
 extern Status (*XESetEventToWire(
     Display*		/* display */,
     int			/* event_number */,
@@ -1321,6 +1373,26 @@ int _XPutBackEvent (
     register Display *dpy,
     register XEvent *event);
 
+extern Bool _XIsEventCookie(
+        Display *dpy,
+        XEvent *ev);
+
+extern void _XFreeEventCookies(
+        Display *dpy);
+
+extern void _XStoreEventCookie(
+        Display *dpy,
+        XEvent *ev);
+
+extern Bool _XFetchEventCookie(
+        Display *dpy,
+        XGenericEventCookie *ev);
+
+extern Bool _XCopyEventCookie(
+        Display *dpy,
+        XGenericEventCookie *in,
+        XGenericEventCookie *out);
+
 _XFUNCPROTOEND
 
 #endif /* _XLIBINT_H_ */
diff --git a/man/Makefile.am b/man/Makefile.am
index b19c5d3..b21d8fb 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -75,6 +75,7 @@ libman_PRE = \
 	XGravityEvent.man \
 	XrmGetFileDatabase.man \
 	XrmGetResource.man \
+	XGetEventData.man \
 	XGetVisualInfo.man \
 	XGetWindowAttributes.man \
 	XGetWindowProperty.man \
@@ -271,6 +272,7 @@ all_shadows =                                \
     $(XGraphicsExposeEvent_shadows)          \
     $(XrmGetFileDatabase_shadows)            \
     $(XrmGetResource_shadows)                \
+    $(XGetEventData_shadows)                 \
     $(XGetVisualInfo_shadows)                \
     $(XGetWindowAttributes_shadows)          \
     $(XGetWindowProperty_shadows)            \
@@ -658,6 +660,10 @@ XrmGetResource_shadows =                    \
     XrmQGetSearchList                       \
     XrmQGetSearchResource
 
+XGetEventData_shadows =                     \
+    XFreeEventData                          \
+    XGenericEventCookie
+
 XGetVisualInfo_shadows =                    \
     XMatchVisualInfo                        \
     XVisualIDFromVisual                     \
@@ -1223,6 +1229,9 @@ shadows.DONE:
 	(for i in $(XrmGetResource_shadows:=.@LIB_MAN_SUFFIX@) ; do \
 	 echo .so man$(LIB_MAN_DIR_SUFFIX)/XrmGetResource.$(LIB_MAN_SUFFIX) > $$i; \
 	 done)
+	(for i in $(XGetEventData_shadows:=.@LIB_MAN_SUFFIX@) ; do \
+	 echo .so man$(LIB_MAN_DIR_SUFFIX)/XGetEventData.$(LIB_MAN_SUFFIX) > $$i; \
+	 done)
 	(for i in $(XGetVisualInfo_shadows:=.@LIB_MAN_SUFFIX@) ; do \
 	 echo .so man$(LIB_MAN_DIR_SUFFIX)/XGetVisualInfo.$(LIB_MAN_SUFFIX) > $$i; \
 	 done)
diff --git a/man/XGetEventData.man b/man/XGetEventData.man
new file mode 100644
index 0000000..10008ed
--- /dev/null
+++ b/man/XGetEventData.man
@@ -0,0 +1,223 @@
+.\" Copyright \(co 2009 Red Hat, Inc.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining a
+.\" copy of this software and associated documentation files (the "Software"),
+.\" to deal in the Software without restriction, including without limitation
+.\" the rights to use, copy, modify, merge, publish, distribute, sublicense,
+.\" and/or sell copies of the Software, and to permit persons to whom the
+.\" Software is furnished to do so, subject to the following conditions:
+.\"
+.\" The above copyright notice and this permission notice (including the next
+.\" paragraph) shall be included in all copies or substantial portions of the
+.\" Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+.\" THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+.\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+.\" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+.\" DEALINGS IN THE SOFTWARE.
+.\"
+.ds xT X Toolkit Intrinsics \- C Language Interface
+.ds xW Athena X Widgets \- C Language X Toolkit Interface
+.ds xL Xlib \- C Language X Interface
+.ds xC Inter-Client Communication Conventions Manual
+.na
+.de Ds
+.nf
+.\\$1D \\$2 \\$1
+.ft 1
+.\".ps \\n(PS
+.\".if \\n(VS>=40 .vs \\n(VSu
+.\".if \\n(VS<=39 .vs \\n(VSp
+..
+.de De
+.ce 0
+.if \\n(BD .DF
+.nr BD 0
+.in \\n(OIu
+.if \\n(TM .ls 2
+.sp \\n(DDu
+.fi
+..
+.de FD
+.LP
+.KS
+.TA .5i 3i
+.ta .5i 3i
+.nf
+..
+.de FN
+.fi
+.KE
+.LP
+..
+.de IN		\" send an index entry to the stderr
+..
+.de C{
+.KS
+.nf
+.D
+.\"
+.\"	choose appropriate monospace font
+.\"	the imagen conditional, 480,
+.\"	may be changed to L if LB is too
+.\"	heavy for your eyes...
+.\"
+.ie "\\*(.T"480" .ft L
+.el .ie "\\*(.T"300" .ft L
+.el .ie "\\*(.T"202" .ft PO
+.el .ie "\\*(.T"aps" .ft CW
+.el .ft R
+.ps \\n(PS
+.ie \\n(VS>40 .vs \\n(VSu
+.el .vs \\n(VSp
+..
+.de C}
+.DE
+.R
+..
+.de Pn
+.ie t \\$1\fB\^\\$2\^\fR\\$3
+.el \\$1\fI\^\\$2\^\fP\\$3
+..
+.de ZN
+.ie t \fB\^\\$1\^\fR\\$2
+.el \fI\^\\$1\^\fP\\$2
+..
+.de hN
+.ie t <\fB\\$1\fR>\\$2
+.el <\fI\\$1\fP>\\$2
+..
+.de NT
+.ne 7
+.ds NO Note
+.if \\n(.$>$1 .if !'\\$2'C' .ds NO \\$2
+.if \\n(.$ .if !'\\$1'C' .ds NO \\$1
+.ie n .sp
+.el .sp 10p
+.TB
+.ce
+\\*(NO
+.ie n .sp
+.el .sp 5p
+.if '\\$1'C' .ce 99
+.if '\\$2'C' .ce 99
+.in +5n
+.ll -5n
+.R
+..
+.		\" Note End -- doug kraft 3/85
+.de NE
+.ce 0
+.in -5n
+.ll +5n
+.ie n .sp
+.el .sp 10p
+..
+.ny0
+.TH XGetEventData __libmansuffix__ __xorgversion__ "XLIB FUNCTIONS"
+.SH NAME
+XGetEventData, XFreeEventData, XGenericEventCookie \- retrieve and free additional event data through cookies.
+.SH SYNTAX
+.HP
+Bool XGetEventData\^(\^Display *\fIdisplay\fP\^, XGenericEventCookie *\fIcookie\fP\^);
+.HP
+void XFreeEventData\^(\^Display *\fIdisplay\fP\^, XGenericEventCookie *\fIcookie\fP\^);
+.HP
+.SH ARGUMENTS
+.IP \fIdisplay\fP 1i
+Specifies the connection to the X server.
+.IP \fIcookie\fP 1i
+Specifies the cookie to free or retrieve the data for.
+
+.SH STRUCTURES
+.Ds 0
+.TA .5i 3i
+.ta .5i 3i
+typedef struct {
+	int type;
+	unsigned long serial;
+	Bool send_event;
+	Display *display;
+	int extension;
+	int evtype;
+	unsigned int cookie;
+	void *data;
+} XGenericEventCookie;
+.De
+
+.SH DESCRIPTION
+Some extension
+.ZN XGenericEvents
+require additional memory to store information.
+For these events, the library returns a
+.ZN XGenericEventCookie
+with a token ('cookie') unique to this event. The
+.ZN XGenericEventCookie 's
+data pointer is undefined until
+.ZN XGetEventData
+is called.
+
+The
+.ZN XGetEventData
+function retrieves this extra data for the given cookie. No round-trip to
+the server is required. If the cookie is invalid or the
+event is not an event handled by cookie handlers,
+.ZN False
+is returned. If
+.ZN XGetEventData
+returns
+.ZN True ,
+the cookie's data pointer points to the memory containing the event
+information. A client must call
+.ZN XFreeEventData
+to free this memory.
+.ZN XGetEventData
+returns
+.ZN False
+for multiple calls for the same event cookie.
+
+The
+.ZN XFreeEventData
+function frees the data associated with a cookie. A client must call
+.ZN XFreeEventData
+for each cookie claimed with
+.ZN XGetEventData .
+
+.SH EXAMPLE CODE
+.Ds 0
+.TA .5i 3i
+.ta .5i 3i
+XEvent event;
+XGenericEventCookie *cookie = &ev;
+
+XNextEvent(display, &event);
+if (XGetEventData(display, cookie)) {
+    handle_cookie_event(cookie->data);
+} else
+    handle_event(&event);
+}
+XFreeEventData(display, cookie);
+.De
+
+.SH NOTES
+A cookie is defined as unclaimed if it has been returned to the client
+through
+.ZN XNextEvent
+but its data has not been retrieved via
+.ZN XGetEventData .
+Subsequent calls to
+.ZN XNextEvent
+may free memory associated with unclaimed cookies.
+Multi-threaded X clients must ensure that
+.ZN XGetEventData
+is called before the next call to
+.ZN XNextEvent .
+
+.SH "SEE ALSO"
+XNextEvent(3X11),
+.br
+\fI\*(xL\fP
+
diff --git a/src/ChkIfEv.c b/src/ChkIfEv.c
index 9bef64f..66f0c3c 100644
--- a/src/ChkIfEv.c
+++ b/src/ChkIfEv.c
@@ -62,6 +62,7 @@ Bool XCheckIfEvent (
 		   && (*predicate)(dpy, &qelt->event, arg)) {
 		    *event = qelt->event;
 		    _XDeq(dpy, prev, qelt);
+		    _XStoreEventCookie(dpy, event);
 		    UnlockDisplay(dpy);
 		    return True;
 		}
diff --git a/src/ChkMaskEv.c b/src/ChkMaskEv.c
index bc1a279..6fb71c9 100644
--- a/src/ChkMaskEv.c
+++ b/src/ChkMaskEv.c
@@ -54,6 +54,10 @@ Bool XCheckMaskEvent (
 	int n;			/* time through count */
 
         LockDisplay(dpy);
+
+	/* Delete unclaimed cookies */
+	_XFreeEventCookies(dpy);
+
 	prev = NULL;
 	for (n = 3; --n >= 0;) {
 	    for (qelt = prev ? prev->next : dpy->head;
diff --git a/src/ChkTypEv.c b/src/ChkTypEv.c
index fc4c7d1..f64ebd3 100644
--- a/src/ChkTypEv.c
+++ b/src/ChkTypEv.c
@@ -48,6 +48,10 @@ Bool XCheckTypedEvent (
 	int n;			/* time through count */
 
         LockDisplay(dpy);
+
+	/* Delete unclaimed cookies */
+	_XFreeEventCookies(dpy);
+
 	prev = NULL;
 	for (n = 3; --n >= 0;) {
 	    for (qelt = prev ? prev->next : dpy->head;
diff --git a/src/ChkTypWEv.c b/src/ChkTypWEv.c
index 6214c36..d791eb2 100644
--- a/src/ChkTypWEv.c
+++ b/src/ChkTypWEv.c
@@ -49,6 +49,10 @@ Bool XCheckTypedWindowEvent (
 	int n;			/* time through count */
 
         LockDisplay(dpy);
+
+	/* Delete unclaimed cookies */
+	_XFreeEventCookies(dpy);
+
 	prev = NULL;
 	for (n = 3; --n >= 0;) {
 	    for (qelt = prev ? prev->next : dpy->head;
diff --git a/src/ChkWinEv.c b/src/ChkWinEv.c
index 1fd975c..b753c5f 100644
--- a/src/ChkWinEv.c
+++ b/src/ChkWinEv.c
@@ -54,6 +54,10 @@ Bool XCheckWindowEvent (
 	int n;			/* time through count */
 
         LockDisplay(dpy);
+
+	/* Delete unclaimed cookies */
+	_XFreeEventCookies(dpy);
+
 	prev = NULL;
 	for (n = 3; --n >= 0;) {
 	    for (qelt = prev ? prev->next : dpy->head;
diff --git a/src/FreeEventData.c b/src/FreeEventData.c
new file mode 100644
index 0000000..e2d40b0
--- /dev/null
+++ b/src/FreeEventData.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include "Xlibint.h"
+
+void
+XFreeEventData(Display *dpy, XGenericEventCookie *event)
+{
+
+    if (_XIsEventCookie(dpy, (XEvent*)event) && event->data)
+    {
+        XFree(event->data);
+        event->data = NULL;
+        event->cookie = 0;
+    }
+    return;
+}
+
diff --git a/src/GetEventData.c b/src/GetEventData.c
new file mode 100644
index 0000000..b93dee6
--- /dev/null
+++ b/src/GetEventData.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include "Xlibint.h"
+
+Bool
+XGetEventData(Display *dpy, XGenericEventCookie *event)
+{
+    Bool rc;
+    LockDisplay(dpy);
+
+    rc = _XFetchEventCookie(dpy, event);
+
+    UnlockDisplay(dpy);
+
+    return rc;
+}
+
diff --git a/src/IfEvent.c b/src/IfEvent.c
index 05a2b82..64c8f46 100644
--- a/src/IfEvent.c
+++ b/src/IfEvent.c
@@ -61,6 +61,7 @@ XIfEvent (
 		   && (*predicate)(dpy, &qelt->event, arg)) {
 		    *event = qelt->event;
 		    _XDeq(dpy, prev, qelt);


Reply to: