tk/tk-seg_input.patch
2009-02-23 12:38:50 +00:00

80 lines
2.5 KiB
Diff

diff -up tk8.5.6/generic/tkEvent.c.old tk8.5.6/generic/tkEvent.c
--- tk8.5.6/generic/tkEvent.c.old 2008-08-05 22:31:53.000000000 +0200
+++ tk8.5.6/generic/tkEvent.c 2009-02-23 12:37:23.000000000 +0100
@@ -247,16 +247,10 @@ InvokeFocusHandlers(
}
/*
- * MouseWheel events are not focus specific on Mac OS X.
+ * Only key-related events are directed according to the focus.
*/
-#ifdef MAC_OSX_TK
-#define FOCUS_DIRECTED_EVENT_MASK (KeyPressMask|KeyReleaseMask)
-#else
-#define FOCUS_DIRECTED_EVENT_MASK (KeyPressMask|KeyReleaseMask|MouseWheelMask)
-#endif
-
- if (mask & FOCUS_DIRECTED_EVENT_MASK) {
+ if (mask & (KeyPressMask|KeyReleaseMask)) {
(*winPtrPtr)->dispPtr->lastEventTime = eventPtr->xkey.time;
*winPtrPtr = TkFocusKeyEvent(*winPtrPtr, eventPtr);
if (*winPtrPtr == NULL) {
@@ -359,6 +353,11 @@ CreateXIC(
XFree(preedit_attlist);
}
+ if (winPtr->inputContext == NULL) {
+ /* XCreateIC failed. */
+ return;
+ }
+
/*
* Adjust the window's event mask if the IM requires it.
*/
@@ -790,7 +789,7 @@ InvokeGenericHandlers(
int done;
tsdPtr->handlersActive++;
- done = (*curPtr->proc)(curPtr->clientData, eventPtr);
+ done = curPtr->proc(curPtr->clientData, eventPtr);
tsdPtr->handlersActive--;
if (done) {
return done;
@@ -1383,7 +1382,7 @@ Tk_HandleEvent(
for (handlerPtr = winPtr->handlerList; handlerPtr != NULL; ) {
if ((handlerPtr->mask & mask) != 0) {
ip.nextHandler = handlerPtr->nextPtr;
- (*(handlerPtr->proc))(handlerPtr->clientData, eventPtr);
+ handlerPtr->proc(handlerPtr->clientData, eventPtr);
handlerPtr = ip.nextHandler;
} else {
handlerPtr = handlerPtr->nextPtr;
@@ -1787,7 +1786,7 @@ WindowEventProc(
return 0;
}
if (tsdPtr->restrictProc != NULL) {
- result = (*tsdPtr->restrictProc)(tsdPtr->restrictArg, &wevPtr->event);
+ result = tsdPtr->restrictProc(tsdPtr->restrictArg, &wevPtr->event);
if (result != TK_PROCESS_EVENT) {
if (result == TK_DEFER_EVENT) {
return 0;
@@ -2053,7 +2052,7 @@ TkFinalize(
firstExitPtr = exitPtr->nextPtr;
Tcl_MutexUnlock(&exitMutex);
- (*exitPtr->proc)(exitPtr->clientData);
+ exitPtr->proc(exitPtr->clientData);
ckfree((char *) exitPtr);
Tcl_MutexLock(&exitMutex);
}
@@ -2103,7 +2102,7 @@ TkFinalizeThread(
*/
tsdPtr->firstExitPtr = exitPtr->nextPtr;
- (*exitPtr->proc)(exitPtr->clientData);
+ exitPtr->proc(exitPtr->clientData);
ckfree((char *) exitPtr);
}
}