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