fix: web, reset cursor on disconn, back to main page (#9192)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
parent
fd178a7b6c
commit
cf06d1028f
@ -784,7 +784,7 @@ class InputModel {
|
|||||||
if (!isInputSourceFlutter) {
|
if (!isInputSourceFlutter) {
|
||||||
bind.sessionEnterOrLeave(sessionId: sessionId, enter: enter);
|
bind.sessionEnterOrLeave(sessionId: sessionId, enter: enter);
|
||||||
}
|
}
|
||||||
if (enter) {
|
if (!isWeb && enter) {
|
||||||
bind.setCurSessionId(sessionId: sessionId);
|
bind.setCurSessionId(sessionId: sessionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2183,6 +2183,7 @@ class CursorModel with ChangeNotifier {
|
|||||||
debugPrint("deleting cursor with key $k");
|
debugPrint("deleting cursor with key $k");
|
||||||
deleteCustomCursor(k);
|
deleteCustomCursor(k);
|
||||||
}
|
}
|
||||||
|
resetSystemCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
trySetRemoteWindowCoords() {
|
trySetRemoteWindowCoords() {
|
||||||
|
@ -9,6 +9,7 @@ import 'package:flutter_hbb/models/model.dart';
|
|||||||
|
|
||||||
deleteCustomCursor(String key) =>
|
deleteCustomCursor(String key) =>
|
||||||
custom_cursor_manager.CursorManager.instance.deleteCursor(key);
|
custom_cursor_manager.CursorManager.instance.deleteCursor(key);
|
||||||
|
resetSystemCursor() {}
|
||||||
|
|
||||||
MouseCursor buildCursorOfCache(
|
MouseCursor buildCursorOfCache(
|
||||||
CursorModel cursor, double scale, CursorData? cache) {
|
CursorModel cursor, double scale, CursorData? cache) {
|
||||||
|
@ -58,6 +58,11 @@ class CursorManager {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> resetSystemCursor() async {
|
||||||
|
latestKey = '';
|
||||||
|
js.context.callMethod('setByName', ['cursor', 'auto']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class FlutterCustomMemoryImageCursor extends MouseCursor {
|
class FlutterCustomMemoryImageCursor extends MouseCursor {
|
||||||
@ -92,6 +97,7 @@ class _FlutterCustomMemoryImageCursorSession extends MouseCursorSession {
|
|||||||
}
|
}
|
||||||
|
|
||||||
deleteCustomCursor(String key) => CursorManager.instance.deleteCursor(key);
|
deleteCustomCursor(String key) => CursorManager.instance.deleteCursor(key);
|
||||||
|
resetSystemCursor() => CursorManager.instance.resetSystemCursor();
|
||||||
|
|
||||||
MouseCursor buildCursorOfCache(
|
MouseCursor buildCursorOfCache(
|
||||||
model.CursorModel cursor, double scale, model.CursorData? cache) {
|
model.CursorModel cursor, double scale, model.CursorData? cache) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user