summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-09-30 14:46:48 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-09-30 14:46:48 (GMT)
commit009394840a93391fb574b4cbc7a9eb114ee3da7b (patch)
treee54a25a1760e53ba8d6d8b8049addba8621c8b41 /generic
parentee2ce93b2a9f94bf0fb220792ca75b6bdce7478c (diff)
parenta7bd1b8b54051af0e4a59ca36d6fa8cbbd221487 (diff)
downloadtk-tip_437.zip
tk-tip_437.tar.gz
tk-tip_437.tar.bz2
merge core-8-5-branch. tip_437
This is the TIP #437 implementation being voted on.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkTextWind.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c
index 8d1f850..5b511d2 100644
--- a/generic/tkTextWind.c
+++ b/generic/tkTextWind.c
@@ -1123,6 +1123,16 @@ TkTextEmbWinDisplayProc(
&lineX, &windowY, &width, &height);
windowX = lineX - chunkPtr->x + x;
+ /*
+ * Mark the window as displayed so that it won't get unmapped.
+ * This needs to be done before the next instruction block because
+ * Tk_MaintainGeometry/Tk_MapWindow will run event handlers, in
+ * particular for the <Map> event, and if the bound script deletes
+ * the embedded window its clients will get freed.
+ */
+
+ client->displayed = 1;
+
if (textPtr->tkwin == Tk_Parent(tkwin)) {
if ((windowX != Tk_X(tkwin)) || (windowY != Tk_Y(tkwin))
|| (Tk_ReqWidth(tkwin) != Tk_Width(tkwin))
@@ -1134,12 +1144,6 @@ TkTextEmbWinDisplayProc(
Tk_MaintainGeometry(tkwin, textPtr->tkwin, windowX, windowY,
width, height);
}
-
- /*
- * Mark the window as displayed so that it won't get unmapped.
- */
-
- client->displayed = 1;
}
/*