--- X11/src/GetWAttrs.c 2003-04-14 03:22:16.000000000 +0800 +++ X11-xorg/src/GetWAttrs.c 2004-08-31 19:37:03.000000000 +0800 @@ -84,10 +83,11 @@ return True; } -Status XGetWindowAttributes(dpy, w, attr) - register Display *dpy; - Window w; - XWindowAttributes *attr; +Status +_XGetWindowAttributes( + register Display *dpy, + Window w, + XWindowAttributes *attr) { xGetGeometryReply rep; register xResourceReq *req; @@ -96,7 +96,6 @@ _XAsyncHandler async; _XWAttrsState async_state; - LockDisplay(dpy); GetResReq(GetWindowAttributes, w, req); async_state.attr_seq = dpy->request; @@ -113,14 +112,10 @@ if (!_XReply (dpy, (xReply *)&rep, 0, xTrue)) { DeqAsyncHandler(dpy, &async); - UnlockDisplay(dpy); - SyncHandle(); return (0); } DeqAsyncHandler(dpy, &async); if (!async_state.attr) { - UnlockDisplay(dpy); - SyncHandle(); return (0); } attr->x = cvtINT16toInt (rep.x); @@ -138,8 +133,22 @@ break; } } + return(1); +} + +Status +XGetWindowAttributes( + Display *dpy, + Window w, + XWindowAttributes *attr) +{ + Status ret; + + LockDisplay(dpy); + ret = _XGetWindowAttributes(dpy, w, attr); UnlockDisplay(dpy); SyncHandle(); - return(1); + + return ret; } --- X11/src/PutBEvent.c 2001-12-15 03:54:03.000000000 +0800 +++ X11-xorg/src/PutBEvent.c 2004-08-31 19:37:03.000000000 +0800 @@ -33,16 +33,14 @@ #include "Xlibint.h" int -XPutBackEvent (dpy, event) - register Display *dpy; - register XEvent *event; +_XPutBackEvent ( + register Display *dpy, + register XEvent *event) { register _XQEvent *qelt; - LockDisplay(dpy); if (!dpy->qfree) { if ((dpy->qfree = (_XQEvent *) Xmalloc (sizeof (_XQEvent))) == NULL) { - UnlockDisplay(dpy); return 0; } dpy->qfree->next = NULL; @@ -56,6 +54,18 @@ if (dpy->tail == NULL) dpy->tail = qelt; dpy->qlen++; - UnlockDisplay(dpy); return 0; } + +int +XPutBackEvent ( + register Display * dpy, + register XEvent *event) + { + int ret; + + LockDisplay(dpy); + ret = _XPutBackEvent(dpy, event); + UnlockDisplay(dpy); + return ret; + } --- X11/src/imDefLkup.c 2004-02-02 00:16:04.000000000 +0800 +++ X11-xorg/src/imDefLkup.c 2004-08-31 19:37:03.000000000 +0800 @@ -463,7 +463,7 @@ Xim im = (Xim )ic->core.im; XWindowAttributes atr; - if (!XGetWindowAttributes(im->core.display, ic->core.focus_window, &atr)) + if (!_XGetWindowAttributes(im->core.display, ic->core.focus_window, &atr)) return 0; return (EVENTMASK)atr.your_event_mask; } --- X11/src/imInsClbk.c 2004-09-29 10:59:15.000000000 +0800 +++ X11-xorg/src/imInsClbk.c 2004-09-20 11:00:23.000000000 +0800 @@ -254,8 +254,15 @@ _XUnregisterFilter( display, RootWindow(display, 0), _XimFilterPropertyNotify, (XPointer)NULL ); -/* PropertyNotify is filtered by FilterServerDestroy too */ #if 0 + /* + * don't unregister the event mask + * (not even the PropertyNotify mask) + * as others may be interested. + * It shouldn't matter if we don't unregister + * as we are in the root window anyway so the + * event won't be propagated any further. + */ XSelectInput( display, RootWindow(display, 0), NoEventMask ); #endif --- X11/src/imLcFlt.c 2001-01-17 06:11:30.000000000 +0800 +++ X11-xorg/imLcFlt.c 2004-08-31 19:37:03.000000000 +0800 @@ -73,7 +73,7 @@ ic->private.local.composed = p; /* return back to client KeyPressEvent keycode == 0 */ ev->xkey.keycode = 0; - XPutBackEvent(d, ev); + _XPutBackEvent(d, ev); /* initialize internal state for next key sequence */ ic->private.local.context = ((Xim)ic->core.im)->private.local.top; return(True); --- X11/include/X11/Xlibint.h 2004-06-28 06:31:31.000000000 +0800 +++ X11-xorg/include/X11/Xlibint.h 2004-08-31 19:37:03.000000000 +0800 @@ -1301,6 +1298,15 @@ int n, int ordering); +Status _XGetWindowAttributes( + register Display *dpy, + Window w, + XWindowAttributes *attr); + +int _XPutBackEvent ( + register Display *dpy, + register XEvent *event); + _XFUNCPROTOEND #endif /* _XLIBINT_H_ */