mirror of
https://github.com/Trensa-Organization/hy3.git
synced 2025-03-15 18:53:40 +01:00
Fix getNextWindowCandidate
returning null if a group is focused
This commit is contained in:
parent
84317d3d2a
commit
f08c7ff2e4
4 changed files with 10 additions and 8 deletions
|
@ -641,7 +641,7 @@ void Hy3Layout::alterSplitRatio(CWindow* pWindow, float delta, bool exact) {
|
|||
std::string Hy3Layout::getLayoutName() { return "hy3"; }
|
||||
|
||||
CWindow* Hy3Layout::getNextWindowCandidate(CWindow* window) {
|
||||
auto* node = this->getWorkspaceFocusedNode(window->m_iWorkspaceID);
|
||||
auto* node = this->getWorkspaceFocusedNode(window->m_iWorkspaceID, true);
|
||||
if (node == nullptr) return nullptr;
|
||||
|
||||
switch (node->data.type) {
|
||||
|
@ -1051,10 +1051,10 @@ Hy3Node* Hy3Layout::getWorkspaceRootGroup(const int& workspace) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
Hy3Node* Hy3Layout::getWorkspaceFocusedNode(const int& workspace) {
|
||||
Hy3Node* Hy3Layout::getWorkspaceFocusedNode(const int& workspace, bool ignore_group_focus) {
|
||||
auto* rootNode = this->getWorkspaceRootGroup(workspace);
|
||||
if (rootNode == nullptr) return nullptr;
|
||||
return rootNode->getFocusedNode();
|
||||
return rootNode->getFocusedNode(ignore_group_focus);
|
||||
}
|
||||
|
||||
void Hy3Layout::renderHook(void*, std::any data) {
|
||||
|
|
|
@ -88,7 +88,7 @@ public:
|
|||
bool shouldRenderSelected(CWindow*);
|
||||
|
||||
Hy3Node* getWorkspaceRootGroup(const int& workspace);
|
||||
Hy3Node* getWorkspaceFocusedNode(const int& workspace);
|
||||
Hy3Node* getWorkspaceFocusedNode(const int& workspace, bool ignore_group_focus = false);
|
||||
|
||||
static void renderHook(void*, std::any);
|
||||
static void windowGroupUrgentHook(void*, std::any);
|
||||
|
|
|
@ -191,14 +191,16 @@ void Hy3Node::raiseToTop() {
|
|||
}
|
||||
}
|
||||
|
||||
Hy3Node* Hy3Node::getFocusedNode() {
|
||||
Hy3Node* Hy3Node::getFocusedNode(bool ignore_group_focus) {
|
||||
switch (this->data.type) {
|
||||
case Hy3NodeType::Window: return this;
|
||||
case Hy3NodeType::Group:
|
||||
if (this->data.as_group.focused_child == nullptr || this->data.as_group.group_focused) {
|
||||
if (this->data.as_group.focused_child == nullptr
|
||||
|| (!ignore_group_focus && this->data.as_group.group_focused))
|
||||
{
|
||||
return this;
|
||||
} else {
|
||||
return this->data.as_group.focused_child->getFocusedNode();
|
||||
return this->data.as_group.focused_child->getFocusedNode(ignore_group_focus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ struct Hy3Node {
|
|||
bool focusWindow();
|
||||
void markFocused();
|
||||
void raiseToTop();
|
||||
Hy3Node* getFocusedNode();
|
||||
Hy3Node* getFocusedNode(bool ignore_group_focus = false);
|
||||
bool isIndirectlyFocused();
|
||||
|
||||
void recalcSizePosRecursive(bool no_animation = false);
|
||||
|
|
Loading…
Add table
Reference in a new issue