diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp index 6ad2d07..d29d801 100644 --- a/src/Hy3Layout.cpp +++ b/src/Hy3Layout.cpp @@ -73,11 +73,14 @@ void Hy3Layout::onWindowCreated(CWindow* window, eDirection direction) { void Hy3Layout::onWindowCreatedTiling(CWindow* window, eDirection) { hy3_log( - TRACE, - "onWindowCreatedTiling called with window {:x} (floating: {})", + LOG, + "onWindowCreatedTiling called with window {:x} (floating: {}, monitor: {}, workspace: {})", (uintptr_t) window, - window->m_bIsFloating + window->m_bIsFloating, + window->m_iMonitorID, + window->m_iWorkspaceID ); + if (window->m_bIsFloating) return; auto* existing = this->getNodeFromWindow(window); @@ -96,17 +99,15 @@ void Hy3Layout::onWindowCreatedTiling(CWindow* window, eDirection) { Hy3Node* opening_into; Hy3Node* opening_after = nullptr; - if (monitor->activeWorkspace != -1) { - auto* root = this->getWorkspaceRootGroup(monitor->activeWorkspace); + auto* root = this->getWorkspaceRootGroup(window->m_iWorkspaceID); - if (root != nullptr) { - opening_after = root->getFocusedNode(); + if (root != nullptr) { + opening_after = root->getFocusedNode(); - // opening_after->parent cannot be nullptr - if (opening_after == root) { - opening_after = - opening_after->intoGroup(Hy3GroupLayout::SplitH, GroupEphemeralityOption::Standard); - } + // opening_after->parent cannot be nullptr + if (opening_after == root) { + opening_after = + opening_after->intoGroup(Hy3GroupLayout::SplitH, GroupEphemeralityOption::Standard); } } diff --git a/src/TabGroup.cpp b/src/TabGroup.cpp index 7888984..af2d989 100644 --- a/src/TabGroup.cpp +++ b/src/TabGroup.cpp @@ -225,8 +225,7 @@ void Hy3TabBarEntry::prepareTexture(float scale, CBox& box) { PangoLayout* layout = pango_cairo_create_layout(cairo); pango_layout_set_text(layout, this->window_title.c_str(), -1); - if (*text_center) - pango_layout_set_alignment(layout, PANGO_ALIGN_CENTER); + if (*text_center) pango_layout_set_alignment(layout, PANGO_ALIGN_CENTER); PangoFontDescription* font_desc = pango_font_description_from_string(text_font->c_str()); pango_font_description_set_size(font_desc, *text_height * scale * PANGO_SCALE);