Index: generic/tkWindow.c
==================================================================
--- generic/tkWindow.c
+++ generic/tkWindow.c
@@ -473,13 +473,10 @@
 	    dispPtr->lastEventTime = CurrentTime;
 	    dispPtr->bindInfoStale = 1;
 	    dispPtr->cursorFont = None;
 	    dispPtr->warpWindow = NULL;
 	    dispPtr->multipleAtom = None;
-#ifdef TK_USE_INPUT_METHODS
-	    dispPtr->ximGeneration = 0;
-#endif /*TK_USE_INPUT_METHODS*/
 
 	    /*
 	     * By default we do want to collapse motion events in
 	     * Tk_QueueWindowEvent.
 	     */
@@ -655,10 +652,11 @@
     winPtr->dirtyAtts = CWEventMask|CWColormap|CWBitGravity;
     winPtr->flags = 0;
     winPtr->handlerList = NULL;
 #ifdef TK_USE_INPUT_METHODS
     winPtr->inputContext = NULL;
+    winPtr->ximGeneration = 0;
 #endif /* TK_USE_INPUT_METHODS */
     winPtr->tagPtr = NULL;
     winPtr->numTags = 0;
     winPtr->optionLevel = -1;
     winPtr->selHandlerList = NULL;

