032636fa21ef19de847af95c13811a50a2039f33

Author
outfoxxed <outfoxxed@outfoxxed.me>
Committer
outfoxxed <outfoxxed@outfoxxed.me>
Date

Message

prevent borders on unfocused workspaces from being left highlighted

Diff

 1diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp
 2index 2b5ca893cb16533b8da16655c3a7a81d3848b84b..fa0f58f93b0920d17d48d2dc1be57bc9dbb7ed8b 100644
 3--- a/src/Hy3Layout.cpp
 4+++ b/src/Hy3Layout.cpp
 5@@ -75,9 +75,18 @@ Hy3Layout::Hy3Layout() {
 6 
 7 	m_windowActiveListener = Event::bus()->m_events.window.active.listen(
 8 	    [this](PHLWINDOW window, Desktop::eFocusReason) {
 9-		    if (!window) return;
10+		    if (!window) {
11+					this->updateGroupBorderColors();
12+			    return;
13+				}
14+
15 		    auto* node = this->getNodeFromWindow(window.get());
16-		    if (!node) return;
17+
18+		    if (!node) {
19+					this->updateGroupBorderColors();
20+					return;
21+				}
22+
23 		    this->onWindowFocusChange(window);
24 	    }
25 	);
26@@ -1371,12 +1380,11 @@ std::string Hy3Layout::debugNodes() {
27 
28 bool Hy3Layout::shouldRenderSelected(const CWindow* window) {
29 	if (window == nullptr) return false;
30+	if (Desktop::focusState()->window()) return false;
31+
32 	auto* root = this->getWorkspaceRootGroup(window->m_workspace.get());
33 	if (root == nullptr || root->as_group().focused_child == nullptr) return false;
34 	auto* focused = &root->getFocusedNode();
35-	if (focused->is_target()
36-	    && focused->as_window() != Desktop::focusState()->window())
37-		return false;
38 
39 	switch (focused->type()) {
40 	case Hy3NodeType::Target: return focused->as_window().get() == window;