mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 01:29:50 +01:00
input: focus window on mouse down on groupbar (#5224)
modified: src/render/decorations/CHyprGroupBarDecoration.cpp
This commit is contained in:
parent
c7c0e795d2
commit
397e08c16a
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue