diff options
author | gcramer <remarcg@gmx.net> | 2017-07-23 17:06:12 (GMT) |
---|---|---|
committer | gcramer <remarcg@gmx.net> | 2017-07-23 17:06:12 (GMT) |
commit | b2c96a4033130f79fbfb5851810096972c9b5984 (patch) | |
tree | a003962458af5d31d1e569773c9a27b1c3b2d94f | |
parent | 42874b94f43eb79b98a80e6fb88552cce596cf20 (diff) | |
download | tk-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.c | 13 |
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"); |