Fix some windows not being marked as active when opened
In some cases, the active event is arriving before the create event. We need to store the currently active address and initialize the windows accordingly
This commit is contained in:
@ -492,7 +492,8 @@ void Workspaces::onWindowOpened(std::string const &payload) {
|
||||
|
||||
std::string windowTitle = payload.substr(nextCommaIdx + 1, payload.length() - nextCommaIdx);
|
||||
|
||||
m_windowsToCreate.emplace_back(workspaceName, windowAddress, windowClass, windowTitle);
|
||||
bool isActive = m_currentActiveWindowAddress == windowAddress;
|
||||
m_windowsToCreate.emplace_back(workspaceName, windowAddress, windowClass, windowTitle, isActive);
|
||||
}
|
||||
|
||||
void Workspaces::onWindowClosed(std::string const &addr) {
|
||||
@ -591,6 +592,7 @@ void Workspaces::onWindowTitleEvent(std::string const &payload) {
|
||||
|
||||
void Workspaces::onActiveWindowChanged(WindowAddress const &activeWindowAddress) {
|
||||
spdlog::trace("Active window changed: {}", activeWindowAddress);
|
||||
m_currentActiveWindowAddress = activeWindowAddress;
|
||||
|
||||
for (auto &[address, window] : m_orphanWindowMap) {
|
||||
if (address == activeWindowAddress) {
|
||||
|
Reference in New Issue
Block a user