I'm showing/hidding some top windows and under some circonstances the window does not get activated back as it should, and the top bar buttons are disabled.
When that happens, the problem is that TopLevelWindowManager::currentActive still points to the topLevelWindow while the isCurrentlyActive flag of the topLevelWindow is false.
Thus a workaround is to add a condition to the test in checkFocus :
if (active != currentActive || (active != nullptr && ! active->isActiveWindow()))
But maybe it make more sense to add something like that to TopLevelWindow::visibilityChanged() :
if (isShowing()) { isCurrentlyActive = TopLevelWindowManager::getInstance()->addWindow (this); } else { TopLevelWindowManager::getInstance()->removeWindow (this); }
does that make sense to you?