From d6aa6af5b3b3cc7c086423cb12c6f2bb76bd15c2 Mon Sep 17 00:00:00 2001 From: Maxim Andreev Date: Tue, 5 May 2026 19:31:09 +0400 Subject: groups: add groupbar middle_click_close option (#14242) --- src/config/values/ConfigValues.cpp | 1 + src/render/decorations/CHyprGroupBarDecoration.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/config/values/ConfigValues.cpp b/src/config/values/ConfigValues.cpp index 0214ba86..2c44b172 100644 --- a/src/config/values/ConfigValues.cpp +++ b/src/config/values/ConfigValues.cpp @@ -412,6 +412,7 @@ std::vector> Values::getConfigValues() { MS("group:groupbar:priority", "sets the decoration priority for groupbars", 3, {.min = 0, .max = 6}), MS("group:groupbar:render_titles", "whether to render titles in the group bar decoration", true), MS("group:groupbar:scrolling", "whether scrolling in the groupbar changes group active window", true), + MS("group:groupbar:middle_click_close", "whether middle clicking the groupbar closes the clicked window", true), MS("group:groupbar:rounding", "how much to round the groupbar", 1, {.min = 0, .max = 20}), MS("group:groupbar:rounding_power", "rounding power of groupbar corners (2 is a circle)", 2, {.min = 2, .max = 10}), MS("group:groupbar:gradient_rounding", "how much to round the groupbar gradient", 2, {.min = 0, .max = 20}), diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index fa4b157e..50b89545 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -431,9 +431,10 @@ bool CHyprGroupBarDecoration::onEndWindowDragOnDeco(const Vector2D& pos, PHLWIND } bool CHyprGroupBarDecoration::onMouseButtonOnDeco(const Vector2D& pos, const IPointer::SButtonEvent& e) { - static auto PSTACKED = CConfigValue("group:groupbar:stacked"); - static auto POUTERGAP = CConfigValue("group:groupbar:gaps_out"); - static auto PINNERGAP = CConfigValue("group:groupbar:gaps_in"); + static auto PSTACKED = CConfigValue("group:groupbar:stacked"); + static auto POUTERGAP = CConfigValue("group:groupbar:gaps_out"); + static auto PINNERGAP = CConfigValue("group:groupbar:gaps_in"); + static auto PMIDDLECLICKCLOSE = CConfigValue("group:groupbar:middle_click_close"); if (m_window->isEffectiveInternalFSMode(FSMODE_FULLSCREEN)) return true; @@ -444,6 +445,9 @@ bool CHyprGroupBarDecoration::onMouseButtonOnDeco(const Vector2D& pos, const IPo // close window on middle click if (e.button == 274) { + if (!*PMIDDLECLICKCLOSE) + return true; + static Vector2D pressedCursorPos; if (e.state == WL_POINTER_BUTTON_STATE_PRESSED) -- cgit v1.2.3