From 8e69c390c791c52db648c453a782e87f06c09bf0 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Tue, 30 May 2023 01:45:48 -0700 Subject: [PATCH] Fix tab bars with multiple monitors --- src/Hy3Layout.cpp | 7 ++++--- src/TabGroup.cpp | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp index 176fd8a..831f02c 100644 --- a/src/Hy3Layout.cpp +++ b/src/Hy3Layout.cpp @@ -1618,14 +1618,15 @@ void Hy3Layout::renderHook(void*, std::any data) { auto& tab_groups = g_Hy3Layout->tab_groups; auto entry = tab_groups.begin(); while (entry != tab_groups.end()) { - if (std::find(rendered_groups.begin(), rendered_groups.end(), &*entry) == rendered_groups.end()) { + if (entry->target_window->m_iMonitorID == g_pHyprOpenGL->m_RenderData.pMonitor->ID + && std::find(rendered_groups.begin(), rendered_groups.end(), &*entry) == rendered_groups.end() + ) { entry->renderTabBar(); if (entry->bar.destroy) tab_groups.erase(entry++); } entry = std::next(entry); - } - + } } break; default: break; diff --git a/src/TabGroup.cpp b/src/TabGroup.cpp index a2403d0..b9eb99e 100644 --- a/src/TabGroup.cpp +++ b/src/TabGroup.cpp @@ -288,7 +288,7 @@ void Hy3TabGroup::renderTabBar() { auto* monitor = g_pHyprOpenGL->m_RenderData.pMonitor; auto scale = monitor->scale; - auto pos = this->pos.vec(); + auto pos = this->pos.vec() - monitor->vecPosition; auto size = this->size.vec(); pos.y += (this->bar.vertical_pos.fl() * size.y) * (*enter_from_top ? -1 : 1); @@ -331,7 +331,7 @@ void Hy3TabGroup::renderTabBar() { for (auto* window: this->stencil_windows) { if (!g_pCompositor->windowExists(window)) continue; - auto wpos = window->m_vRealPosition.vec(); + auto wpos = window->m_vRealPosition.vec() - monitor->vecPosition; auto wsize = window->m_vRealSize.vec(); wlr_box window_box = { wpos.x, wpos.y, wsize.x, wsize.y };