The TabState function in ttkNotebook.c is not setting the TTK_STATE_USER1 flag correctly. This happend when tabs added to the notebook before the tab currently visible in first position was added, are now hidden. The TabState function check 'index == 0' but this is not working correctly when tab are hidden. Looking for the first visible tab should skip hidden tabs. The attached script triggers this problem with the tileqt theme. The attached C file has a patched TabState function.
Script triggering problem