summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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");