Merge pull request #3060 from fufesou/fix/cursor_on_conn
ignore first update cursor postion
This commit is contained in:
commit
1ad55d9914
@ -1157,8 +1157,9 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
|
||||
return state;
|
||||
},
|
||||
setter: (bool v) async {
|
||||
state.value = v;
|
||||
await bind.sessionToggleOption(id: widget.id, value: opt);
|
||||
state.value =
|
||||
bind.sessionGetToggleOptionSync(id: widget.id, arg: opt);
|
||||
},
|
||||
padding: padding,
|
||||
dismissOnClicked: true,
|
||||
|
@ -904,6 +904,7 @@ class CursorModel with ChangeNotifier {
|
||||
double _hoty = 0;
|
||||
double _displayOriginX = 0;
|
||||
double _displayOriginY = 0;
|
||||
bool _firstUpdateMousePos = false;
|
||||
bool gotMouseControl = true;
|
||||
DateTime _lastPeerMouse = DateTime.now()
|
||||
.subtract(Duration(milliseconds: 2 * kMouseControlTimeoutMSec));
|
||||
@ -1121,7 +1122,11 @@ class CursorModel with ChangeNotifier {
|
||||
|
||||
/// Update the cursor position.
|
||||
updateCursorPosition(Map<String, dynamic> evt, String id) async {
|
||||
gotMouseControl = false;
|
||||
if (!_firstUpdateMousePos) {
|
||||
_firstUpdateMousePos = true;
|
||||
} else {
|
||||
gotMouseControl = false;
|
||||
}
|
||||
_lastPeerMouse = DateTime.now();
|
||||
_x = double.parse(evt['x']);
|
||||
_y = double.parse(evt['y']);
|
||||
|
@ -1117,8 +1117,12 @@ impl LoginConfigHandler {
|
||||
} else if name == "show-quality-monitor" {
|
||||
config.show_quality_monitor.v = !config.show_quality_monitor.v;
|
||||
} else {
|
||||
let v = self.options.get(&name).is_some();
|
||||
if v {
|
||||
let is_set = self
|
||||
.options
|
||||
.get(&name)
|
||||
.map(|o| !o.is_empty())
|
||||
.unwrap_or(false);
|
||||
if is_set {
|
||||
self.config.options.remove(&name);
|
||||
} else {
|
||||
self.config.options.insert(name, "Y".to_owned());
|
||||
|
Loading…
x
Reference in New Issue
Block a user