From 41237ea30bc7146402127046ba388785e04b0c74 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 15 Dec 2021 17:17:17 +0200 Subject: [PATCH] Ignore decoration when updating focused window in PointerInput and TouchInput Currently, it's possible to have the case where the pointer input device handler or the touch input device handler thinks that there's a focused window, but the corresponding focused surface in wayland seat is unset, because the pointer hovers the server side decoration. If the server side decoration is destroyed, the input device handler will fail to update wayland seat's focused surface. In order to make pointer input device handler and touch input device handler code more intuitive, this change makes focusUpdate() functions ignore the decoration. BUG: 411884 BUG: 440380 --- src/pointer_input.cpp | 4 +--- src/touch_input.cpp | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/pointer_input.cpp b/src/pointer_input.cpp index 97f9f5f5ce..6019246a7f 100644 --- a/src/pointer_input.cpp +++ b/src/pointer_input.cpp @@ -564,9 +564,7 @@ void PointerInputRedirection::focusUpdate(Toplevel *focusOld, Toplevel *focusNow } auto seat = waylandServer()->seat(); - if (!focusNow || !focusNow->surface() || decoration()) { - // Clean up focused pointer surface if there's no client to take focus, - // or the pointer is on a client without surface or on a decoration. + if (!focusNow || !focusNow->surface()) { seat->setFocusedPointerSurface(nullptr); return; } diff --git a/src/touch_input.cpp b/src/touch_input.cpp index 62c3588360..99a01e662d 100644 --- a/src/touch_input.cpp +++ b/src/touch_input.cpp @@ -95,8 +95,7 @@ void TouchInputRedirection::focusUpdate(Toplevel *focusOld, Toplevel *focusNow) } auto seat = waylandServer()->seat(); - if (!focusNow || !focusNow->surface() || decoration()) { - // no new surface or internal window or on decoration -> cleanup + if (!focusNow || !focusNow->surface()) { seat->setFocusedTouchSurface(nullptr); return; }