summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgcramer <remarcg@gmx.net>2017-07-23 17:06:12 (GMT)
committergcramer <remarcg@gmx.net>2017-07-23 17:06:12 (GMT)
commitb2c96a4033130f79fbfb5851810096972c9b5984 (patch)
treea003962458af5d31d1e569773c9a27b1c3b2d94f
parent42874b94f43eb79b98a80e6fb88552cce596cf20 (diff)
downloadtk-b2c96a4033130f79fbfb5851810096972c9b5984.zip
tk-b2c96a4033130f79fbfb5851810096972c9b5984.tar.gz
tk-b2c96a4033130f79fbfb5851810096972c9b5984.tar.bz2
I reverted the previous fix, because it doesn't work. The current solution is to set currentIndex before NotebookPlaceSlave() will be called, due to my analysis this can have only one side effect: an interveaning call of NotebookPlaceSlaves() will change to the correct tab.
-rw-r--r--generic/ttk/ttkNotebook.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c
index 437ae11..56439a6 100644
--- a/generic/ttk/ttkNotebook.c
+++ b/generic/ttk/ttkNotebook.c
@@ -595,12 +595,8 @@ static void NotebookPlaceSlaves(void *recordPtr)
Notebook *nb = recordPtr;
int currentIndex = nb->notebook.currentIndex;
if (currentIndex >= 0) {
- int activeIndex = nb->notebook.activeIndex;
- int index = (activeIndex >= 0) ? activeIndex : currentIndex;
NotebookDoLayout(nb);
- if (index >= 0) {
- NotebookPlaceSlave(nb, index);
- }
+ NotebookPlaceSlave(nb, currentIndex);
}
}
@@ -631,9 +627,12 @@ static void SelectTab(Notebook *nb, int index)
Ttk_UnmapSlave(nb->notebook.mgr, currentIndex);
}
- NotebookPlaceSlave(nb, index);
-
+ /* Must be set before calling NotebookPlaceSlave(), otherwise it may
+ * happen that NotebookPlaceSlaves(), triggered by an interveaning
+ * geometry request, will swap to old index. */
nb->notebook.currentIndex = index;
+
+ NotebookPlaceSlave(nb, index);
TtkRedisplayWidget(&nb->core);
TtkSendVirtualEvent(nb->core.tkwin, "NotebookTabChanged");