diff --git a/flutter/lib/models/input_model.dart b/flutter/lib/models/input_model.dart index fd1beb6b5..ac78e1730 100644 --- a/flutter/lib/models/input_model.dart +++ b/flutter/lib/models/input_model.dart @@ -784,7 +784,7 @@ class InputModel { if (!isInputSourceFlutter) { bind.sessionEnterOrLeave(sessionId: sessionId, enter: enter); } - if (enter) { + if (!isWeb && enter) { bind.setCurSessionId(sessionId: sessionId); } } diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index d5377ea9a..6f2a9eb2e 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -2183,6 +2183,7 @@ class CursorModel with ChangeNotifier { debugPrint("deleting cursor with key $k"); deleteCustomCursor(k); } + resetSystemCursor(); } trySetRemoteWindowCoords() { diff --git a/flutter/lib/native/custom_cursor.dart b/flutter/lib/native/custom_cursor.dart index 3e53f3cc5..e85d42a55 100644 --- a/flutter/lib/native/custom_cursor.dart +++ b/flutter/lib/native/custom_cursor.dart @@ -9,6 +9,7 @@ import 'package:flutter_hbb/models/model.dart'; deleteCustomCursor(String key) => custom_cursor_manager.CursorManager.instance.deleteCursor(key); +resetSystemCursor() {} MouseCursor buildCursorOfCache( CursorModel cursor, double scale, CursorData? cache) { diff --git a/flutter/lib/web/custom_cursor.dart b/flutter/lib/web/custom_cursor.dart index fd1fc4a18..54df77e98 100644 --- a/flutter/lib/web/custom_cursor.dart +++ b/flutter/lib/web/custom_cursor.dart @@ -58,6 +58,11 @@ class CursorManager { ]); } } + + Future resetSystemCursor() async { + latestKey = ''; + js.context.callMethod('setByName', ['cursor', 'auto']); + } } class FlutterCustomMemoryImageCursor extends MouseCursor { @@ -92,6 +97,7 @@ class _FlutterCustomMemoryImageCursorSession extends MouseCursorSession { } deleteCustomCursor(String key) => CursorManager.instance.deleteCursor(key); +resetSystemCursor() => CursorManager.instance.resetSystemCursor(); MouseCursor buildCursorOfCache( model.CursorModel cursor, double scale, model.CursorData? cache) {