delay 3s to adjust window after changing resolution

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2023-02-23 21:57:45 +08:00
parent f5edf44f0f
commit 69f16ccd9f

View File

@ -1351,6 +1351,14 @@ class _DisplayMenuState extends State<_DisplayMenu> {
if (w != null && h != null) {
await bind.sessionChangeResolution(
id: widget.id, width: w, height: h);
Future.delayed(Duration(seconds: 3), () async {
final display = widget.ffi.ffiModel.display;
if (w == display.width && h == display.height) {
if (_isWindowCanBeAdjusted()) {
_doAdjustWindow();
}
}
});
}
}
}