Tk Source Code

View Ticket
Login
Ticket UUID: 4966cad4d4807585652ef7c2380a88f208a6e81
Title: Wrong tab shown in ttk::notebook
Type: Bug Version: 8.6/8.7
Submitter: gcramer Created on: 2017-07-21 13:53:10
Subsystem: 88. Themed Tk Assigned To: gcramer
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2017-08-08 19:33:34
Resolution: Fixed Closed By: fvogel
    Closed on: 2017-08-08 19:33:34
Description:
In application Scidb I have three tabs in main notebook: Information, Database, and Board. Sometimes it happens that when switching from Database tab to Information tab (via mouse click in tab bar) the Information tab is flickering a short time, and then the Database tab is still visible, although the Information tab is displayed as selected in tab bar.

I found out that sometimes via a geometry request the function NotebookPlaceSlaves() (ttkNotebook.c) will be triggered after function SelectTab() has been entered, but before the current index is set to new tab index, and this function will change back to previous tab (current index = Database tab), because this function is not regarding the index of the active tab, in this case it's the newly selected Information tab.
User Comments: fvogel added on 2017-08-08 19:33:34:
Okay, trusting you in that.

Merged to core-8-6-branch and trunk.

Thanks!

gcramer added on 2017-08-06 23:01:25:

I don't have a script, it happens in Scidb, a huge application with a very complex widget hierarchy. But it is reproducible: install Scidb from repository, start scidb-beta, select Board tab, then select Database tab, then select Information tab, and it will show the Database tab, although the Information tab handle is shown as selected. I'm working with the patch since two weeks, and it works properly, everything is okay.


fvogel added on 2017-08-06 19:02:04:
The fix (the second one) looks OK to me.

Any script you can show, that would demonstrate the bug perhaps? It's probably a bit difficult because this is likely to be triggered by a race condition.

gcramer added on 2017-07-23 17:11:19:
The first fix [168b6715] did not work properly, so I have reverted the changes.

The second fix [168b6715] now is setting currentIndex before NotebookPlaceSlave() will be invoked, due to my analysis this can have only one side effect: an interveaning call of NotebookPlaceSlaves() will change to the correct tab.

gcramer added on 2017-07-21 14:07:37:
A fix has been committed with [168b6715]. Now the active index will be regarded when processing the geometry request.

Attachments: