Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-01-30 22:12:36 +08:00
parent 99bf4e939c
commit 0765f7057f
3 changed files with 17 additions and 3 deletions

View File

@ -379,9 +379,15 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
mod_menu.PopupMenuItem<String>(
height: _MenubarTheme.height,
padding: EdgeInsets.zero,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: rowChildren),
child: Listener(
onPointerHover: (PointerHoverEvent e) =>
widget.ffi.inputModel.lastMousePos = e.position,
child: MouseRegion(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: rowChildren),
),
),
)
];
},

View File

@ -408,6 +408,13 @@ class InputModel {
}
}
void refreshMousePos() => handleMouse({
'x': lastMousePos.dx,
'y': lastMousePos.dy,
'buttons': 0,
'type': _kMouseEventMove,
});
void handleMouse(Map<String, dynamic> evt) {
double x = evt['x'];
double y = max(0.0, evt['y']);

View File

@ -244,6 +244,7 @@ class FfiModel with ChangeNotifier {
parent.target?.canvasModel.updateViewStyle();
}
parent.target?.recordingModel.onSwitchDisplay();
parent.target?.inputModel.refreshMousePos();
notifyListeners();
}