input: focus window on mouse down on groupbar (#5224)

modified:   src/render/decorations/CHyprGroupBarDecoration.cpp
This commit is contained in:
MightyPlaza 2024-03-22 17:41:20 +00:00 committed by GitHub
parent c7c0e795d2
commit 397e08c16a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -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);