diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 4d25e6d0d..3fce132c6 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -1337,7 +1337,7 @@ class LastWindowPosition { return LastWindowPosition(m["width"], m["height"], m["offsetWidth"], m["offsetHeight"], m["isMaximized"]); } catch (e) { - debugPrintStack(label: e.toString()); + debugPrintStack(label: 'Failed to load LastWindowPosition "$content" ${e.toString()}'); return null; } } diff --git a/flutter/lib/common/widgets/remote_input.dart b/flutter/lib/common/widgets/remote_input.dart index 49c8879f3..b2a22a650 100644 --- a/flutter/lib/common/widgets/remote_input.dart +++ b/flutter/lib/common/widgets/remote_input.dart @@ -93,8 +93,8 @@ class _RawTouchGestureDetectorRegionState } if (handleTouch) { ffi.cursorModel.move(d.localPosition.dx, d.localPosition.dy); + inputModel.tapDown(MouseButtons.left); } - inputModel.tapDown(MouseButtons.left); } onTapUp(TapUpDetails d) { @@ -107,6 +107,13 @@ class _RawTouchGestureDetectorRegionState inputModel.tapUp(MouseButtons.left); } + onTap() { + if (lastDeviceKind != PointerDeviceKind.touch) { + return; + } + inputModel.tap(MouseButtons.left); + } + onDoubleTapDown(TapDownDetails d) { lastDeviceKind = d.kind; if (lastDeviceKind != PointerDeviceKind.touch) { @@ -115,6 +122,9 @@ class _RawTouchGestureDetectorRegionState if (handleTouch) { ffi.cursorModel.move(d.localPosition.dx, d.localPosition.dy); } + if (!ffiModel.touchMode) { + inputModel.tapDown(MouseButtons.left); + } } onDoubleTap() { @@ -156,7 +166,7 @@ class _RawTouchGestureDetectorRegionState if (lastDeviceKind != PointerDeviceKind.touch) { return; } - if (isDesktop || !handleTouch) { + if (isDesktop || !ffiModel.touchMode) { inputModel.tap(MouseButtons.right); } } @@ -291,7 +301,8 @@ class _RawTouchGestureDetectorRegionState () => TapGestureRecognizer(), (instance) { instance ..onTapDown = onTapDown - ..onTapUp = onTapUp; + ..onTapUp = onTapUp + ..onTap = onTap; }), DoubleTapGestureRecognizer: GestureRecognizerFactoryWithHandlers(