Fix window lastFocusedChild not being updated

This commit is contained in:
outfoxxed 2023-04-19 21:17:48 -07:00
parent bd3d973fbf
commit cffbfbe63d
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E

View file

@ -551,10 +551,15 @@ CWindow* Hy3Layout::getNextWindowCandidate(CWindow* window) {
void Hy3Layout::onWindowFocusChange(CWindow* window) {
Debug::log(LOG, "Switched windows from %p to %p", this->lastActiveWindow, window);
auto* node = this->getNodeFromWindow(this->lastActiveWindow);
if (node != nullptr) Debug::log(LOG, "Switched focused node to %p (parent: %p)", node, node->parent);
this->lastActiveWindow = window;
auto* node = this->getNodeFromWindow(this->lastActiveWindow);
if (node == nullptr) return;
Debug::log(LOG, "Switched focused node to %p (parent: %p)", node, node->parent);
while (node->parent != nullptr) {
node->parent->data.as_group.lastFocusedChild = node;
node = node->parent;
}
}
bool Hy3Layout::isWindowTiled(CWindow* window) {