mirror of
https://github.com/Trensa-Organization/hy3.git
synced 2025-03-15 18:53:40 +01:00
Open windows after selected node (not selected window)
This commit is contained in:
parent
f2e3c4d000
commit
f32db7247e
1 changed files with 26 additions and 11 deletions
|
@ -764,18 +764,33 @@ void Hy3Layout::onWindowCreatedTiling(CWindow* window) {
|
|||
auto* monitor = g_pCompositor->getMonitorFromID(window->m_iMonitorID);
|
||||
|
||||
Hy3Node* opening_into;
|
||||
Hy3Node* opening_after;
|
||||
Hy3Node* opening_after = nullptr;
|
||||
|
||||
if (g_pCompositor->m_pLastWindow != nullptr && !g_pCompositor->m_pLastWindow->m_bIsFloating
|
||||
&& g_pCompositor->m_pLastWindow != window
|
||||
&& g_pCompositor->m_pLastWindow->m_iWorkspaceID == window->m_iWorkspaceID
|
||||
&& g_pCompositor->m_pLastWindow->m_bIsMapped)
|
||||
{
|
||||
opening_after = this->getNodeFromWindow(g_pCompositor->m_pLastWindow);
|
||||
} else {
|
||||
opening_after = this->getNodeFromWindow(
|
||||
g_pCompositor->vectorToWindowTiled(g_pInputManager->getMouseCoordsInternal())
|
||||
);
|
||||
if (monitor->activeWorkspace != -1) {
|
||||
auto* root = this->getWorkspaceRootGroup(monitor->activeWorkspace);
|
||||
|
||||
if (root != nullptr) {
|
||||
opening_after = root->getFocusedNode();
|
||||
|
||||
// opening_after->parent cannot be nullptr
|
||||
if (opening_after == root) {
|
||||
opening_after = root->data.as_group.focused_child;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (opening_after == nullptr) {
|
||||
if (g_pCompositor->m_pLastWindow != nullptr && !g_pCompositor->m_pLastWindow->m_bIsFloating
|
||||
&& g_pCompositor->m_pLastWindow != window
|
||||
&& g_pCompositor->m_pLastWindow->m_iWorkspaceID == window->m_iWorkspaceID
|
||||
&& g_pCompositor->m_pLastWindow->m_bIsMapped)
|
||||
{
|
||||
opening_after = this->getNodeFromWindow(g_pCompositor->m_pLastWindow);
|
||||
} else {
|
||||
opening_after = this->getNodeFromWindow(
|
||||
g_pCompositor->vectorToWindowTiled(g_pInputManager->getMouseCoordsInternal())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (opening_after != nullptr && opening_after->workspace_id != window->m_iWorkspaceID) {
|
||||
|
|
Loading…
Add table
Reference in a new issue