mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 01:46:00 +01:00
layerSurface: fix layer being refocused every commit with on_demand (#6487)
* layerSurface: fix layer being refocused every commit with on_demand Fixes #6477 The surface will now only receive focus when its keyboard interactivity is more than the previous keyboard interactivity in the order none -> on_demand -> exclusive. * layerSurface: only kb focus if becoming exclusive
This commit is contained in:
parent
8055b1c00a
commit
9cd5b3587c
1 changed files with 2 additions and 3 deletions
|
@ -317,9 +317,8 @@ void CLayerSurface::onCommit() {
|
||||||
// so unfocus the surface here.
|
// so unfocus the surface here.
|
||||||
g_pCompositor->focusSurface(nullptr);
|
g_pCompositor->focusSurface(nullptr);
|
||||||
g_pInputManager->refocusLastWindow(g_pCompositor->getMonitorFromID(monitorID));
|
g_pInputManager->refocusLastWindow(g_pCompositor->getMonitorFromID(monitorID));
|
||||||
} else if (!WASEXCLUSIVE && !WASLASTFOCUS &&
|
} else if (!WASEXCLUSIVE && ISEXCLUSIVE) {
|
||||||
(ISEXCLUSIVE || (layerSurface->current.interactivity && (g_pSeatManager->mouse.expired() || !g_pInputManager->isConstrained())))) {
|
// if now exclusive and not previously
|
||||||
// if not focused last and exclusive or accepting input + unconstrained
|
|
||||||
g_pSeatManager->setGrab(nullptr);
|
g_pSeatManager->setGrab(nullptr);
|
||||||
g_pInputManager->releaseAllMouseButtons();
|
g_pInputManager->releaseAllMouseButtons();
|
||||||
g_pCompositor->focusSurface(surface->resource());
|
g_pCompositor->focusSurface(surface->resource());
|
||||||
|
|
Loading…
Reference in a new issue