From 8ad538c98beb40c5503cb9258c721776dce12e37 Mon Sep 17 00:00:00 2001 From: Justin Mitchell Date: Mon, 15 Jun 2026 16:28:23 -0400 Subject: [PATCH] Fix back gesture to use logical screen coordinates Changed the fallback corner gesture detection to use logical (orientation-mapped) coordinates instead of native panel coordinates. This ensures the gesture area remains in the visual top-left corner across all screen orientations, particularly for screens without a header or Back button target like the reader. --- src/MappedInputManager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/MappedInputManager.cpp b/src/MappedInputManager.cpp index abde5d48..77da09e6 100644 --- a/src/MappedInputManager.cpp +++ b/src/MappedInputManager.cpp @@ -70,8 +70,11 @@ bool MappedInputManager::wasBackGesture() const { renderer.tapToLogical(nx, ny, lx, ly); int id = 0; if (TouchRegistry::getInstance().hitTest(lx, ly, TouchRegistry::Back, id)) return true; - // Fallback corner gesture (panel-native, generous; works even with no Back target). - return nx <= BACK_GESTURE_FRAC_X && ny <= BACK_GESTURE_FRAC_Y; + // Fallback corner gesture: top-left of the LOGICAL screen (orientation-mapped), so + // it lands on the visual top-left in every orientation and works on screens with no + // header/Back target (e.g. the reader). + return lx <= renderer.getScreenWidth() * BACK_GESTURE_FRAC_X && + ly <= renderer.getScreenHeight() * BACK_GESTURE_FRAC_Y; } bool MappedInputManager::wasItemTapped(int& id) const {