aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/desktop/LayerSurface.cpp
diff options
context:
space:
mode:
authoroutfoxxed <[email protected]>2024-06-14 02:52:37 -0700
committerGitHub <[email protected]>2024-06-14 11:52:37 +0200
commit9cd5b3587cb1e3d42b647fa230024cd0153ea9cb (patch)
tree902bab90f1a2e5e33115fc2fc47c8c4d2cc4728c /src/desktop/LayerSurface.cpp
parent8055b1c00a102f5419e40f5eddfb6ee8be693f33 (diff)
downloadHyprland-9cd5b3587cb1e3d42b647fa230024cd0153ea9cb.tar.gz
Hyprland-9cd5b3587cb1e3d42b647fa230024cd0153ea9cb.zip
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
Diffstat (limited to 'src/desktop/LayerSurface.cpp')
-rw-r--r--src/desktop/LayerSurface.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/desktop/LayerSurface.cpp b/src/desktop/LayerSurface.cpp
index 2eb66440..64eeead1 100644
--- a/src/desktop/LayerSurface.cpp
+++ b/src/desktop/LayerSurface.cpp
@@ -317,9 +317,8 @@ void CLayerSurface::onCommit() {
// so unfocus the surface here.
g_pCompositor->focusSurface(nullptr);
g_pInputManager->refocusLastWindow(g_pCompositor->getMonitorFromID(monitorID));
- } else if (!WASEXCLUSIVE && !WASLASTFOCUS &&
- (ISEXCLUSIVE || (layerSurface->current.interactivity && (g_pSeatManager->mouse.expired() || !g_pInputManager->isConstrained())))) {
- // if not focused last and exclusive or accepting input + unconstrained
+ } else if (!WASEXCLUSIVE && ISEXCLUSIVE) {
+ // if now exclusive and not previously
g_pSeatManager->setGrab(nullptr);
g_pInputManager->releaseAllMouseButtons();
g_pCompositor->focusSurface(surface->resource());