summaryrefslogtreecommitdiffstats
path: root/generic/tkWindow.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-15 16:07:06 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-15 16:07:06 (GMT)
commit6130ca3ef131a8459a378ee9e3fa67484d6fe178 (patch)
tree767bdf02a5953ce6966e4eb8e6eded15ceb364fb /generic/tkWindow.c
parente63cc287cacc144a9a0a5c405d49cca44b37e574 (diff)
downloadtk-6130ca3ef131a8459a378ee9e3fa67484d6fe178.zip
tk-6130ca3ef131a8459a378ee9e3fa67484d6fe178.tar.gz
tk-6130ca3ef131a8459a378ee9e3fa67484d6fe178.tar.bz2
Proposed fix for [7d967c68a09e07e355358af40f36dd5dd84c7022|7d967c68]: Tk applications segmentation fault when ibus-daemon IME is restartedbug_7d967c68
Diffstat (limited to 'generic/tkWindow.c')
-rw-r--r--generic/tkWindow.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 5855b7c..85c5590 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -355,6 +355,9 @@ CreateTopLevelWindow(
* Set the flags specified in the call.
*/
+#ifdef TK_USE_INPUT_METHODS
+ winPtr->ximGeneration = 0;
+#endif /*TK_USE_INPUT_METHODS*/
winPtr->flags |= flags;
/*
@@ -472,6 +475,9 @@ GetScreen(
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
@@ -1442,10 +1448,11 @@ Tk_DestroyWindow(
UnlinkWindow(winPtr);
TkEventDeadWindow(winPtr);
#ifdef TK_USE_INPUT_METHODS
- if (winPtr->inputContext != NULL) {
+ if (winPtr->inputContext != NULL &&
+ winPtr->ximGeneration == winPtr->dispPtr->ximGeneration) {
XDestroyIC(winPtr->inputContext);
- winPtr->inputContext = NULL;
}
+ winPtr->inputContext = NULL;
#endif /* TK_USE_INPUT_METHODS */
if (winPtr->tagPtr != NULL) {
TkFreeBindingTags(winPtr);