diff options
| author | MightyPlaza <123664421+MightyPlaza@users.noreply.github.com> | 2024-03-22 17:41:20 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-22 17:41:20 +0000 |
| commit | 397e08c16a7b7e414e8ef466e22fe5d4a581bafc (patch) | |
| tree | 0b47571dd5854888d047b73b30e9d327baa5b6ad /src/render/decorations/CHyprGroupBarDecoration.cpp | |
| parent | c7c0e795d26b34391f0cb95fd900fc642316827f (diff) | |
input: focus window on mouse down on groupbar (#5224)
modified: src/render/decorations/CHyprGroupBarDecoration.cpp
Diffstat (limited to 'src/render/decorations/CHyprGroupBarDecoration.cpp')
| -rw-r--r-- | src/render/decorations/CHyprGroupBarDecoration.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index defff9ba..a03d97f9 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -425,6 +425,7 @@ bool CHyprGroupBarDecoration::onMouseButtonOnDeco(const Vector2D& pos, wlr_point const float BARRELATIVEX = pos.x - assignedBoxGlobal().x; const int WINDOWINDEX = (BARRELATIVEX) / (m_fBarWidth + BAR_HORIZONTAL_PADDING); + static auto PFOLLOWMOUSE = CConfigValue<Hyprlang::INT>("input:follow_mouse"); // close window on middle click if (e->button == 274) { @@ -453,6 +454,9 @@ bool CHyprGroupBarDecoration::onMouseButtonOnDeco(const Vector2D& pos, wlr_point if (pWindow != m_pWindow) pWindow->setGroupCurrent(pWindow); + if (!g_pCompositor->isWindowActive(pWindow) && *PFOLLOWMOUSE != 3) + g_pCompositor->focusWindow(pWindow); + if (pWindow->m_bIsFloating) g_pCompositor->changeWindowZOrder(pWindow, 1); |
