summaryrefslogtreecommitdiff
path: root/src/events/Layers.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-05-09 17:01:18 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-05-09 17:01:18 +0100
commit7fde80f38eefef4ec1e682947c4ae152aa0974db (patch)
tree7d25b9871264e5414fda0254be4e034733e72743 /src/events/Layers.cpp
parentcc4ccfdbfdf50d759d6a611dbb69468f74401b3a (diff)
layers: fix wonky focus on multimon
Diffstat (limited to 'src/events/Layers.cpp')
-rw-r--r--src/events/Layers.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp
index 56ab11ae..32c58f5d 100644
--- a/src/events/Layers.cpp
+++ b/src/events/Layers.cpp
@@ -111,8 +111,8 @@ void Events::listener_mapLayerSurface(void* owner, void* data) {
layersurface->layerSurface->mapped = true;
layersurface->mapped = true;
-
- layersurface->surface = layersurface->layerSurface->surface;
+ layersurface->keyboardExclusive = layersurface->layerSurface->current.keyboard_interactive;
+ layersurface->surface = layersurface->layerSurface->surface;
// anim
layersurface->alpha.setConfig(g_pConfigManager->getAnimationPropertyConfig("fadeIn"));
@@ -325,7 +325,7 @@ void Events::listener_commitLayerSurface(void* owner, void* data) {
if (layersurface->layerSurface->current.keyboard_interactive &&
(!g_pCompositor->m_sSeat.mouse || !g_pCompositor->m_sSeat.mouse->currentConstraint) // don't focus if constrained
- && g_pCompositor->m_pLastFocus != layersurface->layerSurface->surface) {
+ && !layersurface->keyboardExclusive) {
g_pCompositor->focusSurface(layersurface->layerSurface->surface);
const auto LOCAL =
@@ -333,10 +333,12 @@ void Events::listener_commitLayerSurface(void* owner, void* data) {
wlr_seat_pointer_notify_enter(g_pCompositor->m_sSeat.seat, layersurface->layerSurface->surface, LOCAL.x, LOCAL.y);
wlr_seat_pointer_notify_motion(g_pCompositor->m_sSeat.seat, 0, LOCAL.x, LOCAL.y);
} else if (!layersurface->layerSurface->current.keyboard_interactive && (!g_pCompositor->m_sSeat.mouse || !g_pCompositor->m_sSeat.mouse->currentConstraint) &&
- g_pCompositor->m_pLastFocus == layersurface->layerSurface->surface) {
+ layersurface->keyboardExclusive) {
g_pInputManager->refocus();
}
+ layersurface->keyboardExclusive = layersurface->layerSurface->current.keyboard_interactive;
+
g_pHyprRenderer->damageSurface(layersurface->layerSurface->surface, layersurface->position.x, layersurface->position.y);
g_pProtocolManager->m_pFractionalScaleProtocolManager->setPreferredScaleForSurface(layersurface->layerSurface->surface, PMONITOR->scale);