diff options
Diffstat (limited to 'unix/tkUnixEvent.c')
-rw-r--r-- | unix/tkUnixEvent.c | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c index 67cff2d..c7f126f 100644 --- a/unix/tkUnixEvent.c +++ b/unix/tkUnixEvent.c @@ -113,7 +113,7 @@ DisplayExitHandler( TkDisplay * TkpOpenDisplay( - CONST char *displayNameStr) + const char *displayNameStr) { TkDisplay *dispPtr; Display *display = XOpenDisplay(displayNameStr); @@ -121,14 +121,14 @@ TkpOpenDisplay( if (display == NULL) { return NULL; } - dispPtr = (TkDisplay *) ckalloc(sizeof(TkDisplay)); + dispPtr = ckalloc(sizeof(TkDisplay)); memset(dispPtr, 0, sizeof(TkDisplay)); dispPtr->display = display; #ifdef TK_USE_INPUT_METHODS OpenIM(dispPtr); #endif Tcl_CreateFileHandler(ConnectionNumber(display), TCL_READABLE, - DisplayFileProc, (ClientData) dispPtr); + DisplayFileProc, dispPtr); return dispPtr; } @@ -154,8 +154,6 @@ TkpCloseDisplay( { TkSendCleanup(dispPtr); - TkFreeXId(dispPtr); - TkWmCleanup(dispPtr); #ifdef TK_USE_INPUT_METHODS @@ -204,7 +202,7 @@ TkClipCleanup( dispPtr->windowAtom); Tk_DestroyWindow(dispPtr->clipWindow); - Tcl_Release((ClientData) dispPtr->clipWindow); + Tcl_Release(dispPtr->clipWindow); dispPtr->clipWindow = NULL; } } @@ -280,6 +278,9 @@ TransferXEventsToTcl( int type; XEvent x; TkKeyEvent k; +#ifdef GenericEvent + xGenericEvent xge; +#endif } event; Window w; TkDisplay *dispPtr = NULL; @@ -297,6 +298,12 @@ TransferXEventsToTcl( while (QLength(display) > 0) { XNextEvent(display, &event.x); +#ifdef GenericEvent + if (event.type == GenericEvent) { + Tcl_Panic("Wild GenericEvent; panic! (extension=%d,evtype=%d)", + event.xge.extension, event.xge.evtype); + } +#endif w = None; if (event.type == KeyPress || event.type == KeyRelease) { for (dispPtr = TkGetDisplayList(); ; dispPtr = dispPtr->nextPtr) { @@ -544,7 +551,7 @@ TkUnixDoOneXEvent( index = fd/(NBBY*sizeof(fd_mask)); bit = ((fd_mask)1) << (fd%(NBBY*sizeof(fd_mask))); if ((readMask[index] & bit) || (QLength(dispPtr->display) > 0)) { - DisplayFileProc((ClientData)dispPtr, TCL_READABLE); + DisplayFileProc(dispPtr, TCL_READABLE); } } if (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) { @@ -687,6 +694,22 @@ error: } #endif /* TK_USE_INPUT_METHODS */ +void +TkpWarpPointer( + TkDisplay *dispPtr) +{ + Window w; /* Which window to warp relative to. */ + + if (dispPtr->warpWindow != NULL) { + w = Tk_WindowId(dispPtr->warpWindow); + } else { + w = RootWindow(dispPtr->display, + Tk_ScreenNumber(dispPtr->warpMainwin)); + } + XWarpPointer(dispPtr->display, None, w, 0, 0, 0, 0, + (int) dispPtr->warpX, (int) dispPtr->warpY); +} + /* * Local Variables: * mode: c |