From 63b0f1a2f7b258b76beea87e29fb723df734d2f6 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Fri, 20 May 2022 14:09:27 +0200 Subject: [PATCH] wm: transpose touch events to window positions This patch enhances the window manager with the ability to transform touch events analogously to absolute motion events. Issue #4514 --- repos/gems/src/server/wm/gui.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/repos/gems/src/server/wm/gui.h b/repos/gems/src/server/wm/gui.h index c89878a846..21a94d90d6 100644 --- a/repos/gems/src/server/wm/gui.h +++ b/repos/gems/src/server/wm/gui.h @@ -552,6 +552,11 @@ class Wm::Gui::Session_component : public Rpc_object, ev = Input::Absolute_motion{p.x(), p.y()}; }); + ev.handle_touch([&] (Input::Touch_id id, float x, float y) { + ev = Input::Touch { .id = id, + .x = x + (float)origin.x(), + .y = y + (float)origin.y() }; }); + return ev; }