Fix the last selected node on a workspace always being highlighted

If a floating window or other workspace was focused, the highlight
would remain.
This commit is contained in:
outfoxxed 2023-06-21 21:39:41 -07:00
parent 102360f96a
commit 96bd425544
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E

View file

@ -1816,7 +1816,10 @@ bool Hy3Layout::shouldRenderSelected(CWindow* window) {
auto* root = this->getWorkspaceRootGroup(window->m_iWorkspaceID);
if (root == nullptr || root->data.as_group.focused_child == nullptr) return false;
auto* focused = root->getFocusedNode();
if (focused == nullptr) return false;
if (focused == nullptr
|| (focused->data.type == Hy3NodeData::Window
&& focused->data.as_window != g_pCompositor->m_pLastWindow))
return false;
switch (focused->data.type) {
case Hy3NodeData::Window: return focused->data.as_window == window;