opt: add debug output
This commit is contained in:
parent
200d8dc0f5
commit
7fe42e312f
@ -1037,7 +1037,7 @@ Future<void> saveWindowPosition(WindowType type, {int? windowId}) async {
|
|||||||
final isMaximized = await wc.isMaximized();
|
final isMaximized = await wc.isMaximized();
|
||||||
final pos = LastWindowPosition(
|
final pos = LastWindowPosition(
|
||||||
sz.width, sz.height, position.dx, position.dy, isMaximized);
|
sz.width, sz.height, position.dx, position.dy, isMaximized);
|
||||||
print("saving frame: ${windowId}: ${pos.width}/${pos.height}, offset:${pos.offsetWidth}/${pos.offsetHeight}");
|
debugPrint("saving frame: ${windowId}: ${pos.width}/${pos.height}, offset:${pos.offsetWidth}/${pos.offsetHeight}");
|
||||||
await Get.find<SharedPreferences>()
|
await Get.find<SharedPreferences>()
|
||||||
.setString(kWindowPrefix + type.name, pos.toString());
|
.setString(kWindowPrefix + type.name, pos.toString());
|
||||||
break;
|
break;
|
||||||
@ -1175,7 +1175,7 @@ Future<bool> restoreWindowPosition(WindowType type, {int? windowId}) async {
|
|||||||
await _adjustRestoreMainWindowSize(lpos.width, lpos.height);
|
await _adjustRestoreMainWindowSize(lpos.width, lpos.height);
|
||||||
final offset = await _adjustRestoreMainWindowOffset(
|
final offset = await _adjustRestoreMainWindowOffset(
|
||||||
lpos.offsetWidth, lpos.offsetHeight);
|
lpos.offsetWidth, lpos.offsetHeight);
|
||||||
print("restore lpos: ${size.width}/${size.height}, offset:${offset?.dx}/${offset?.dy}");
|
debugPrint("restore lpos: ${size.width}/${size.height}, offset:${offset?.dx}/${offset?.dy}");
|
||||||
if (offset == null) {
|
if (offset == null) {
|
||||||
await wc.center();
|
await wc.center();
|
||||||
} else {
|
} else {
|
||||||
|
@ -500,19 +500,15 @@ class WindowActionPanelState extends State<WindowActionPanel>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void onWindowClose() async {
|
void onWindowClose() async {
|
||||||
print("onWindowClose");
|
|
||||||
// hide window on close
|
// hide window on close
|
||||||
if (widget.isMainWindow) {
|
if (widget.isMainWindow) {
|
||||||
await windowManager.hide();
|
await windowManager.hide();
|
||||||
rustDeskWinManager.unregisterActiveWindow(0);
|
rustDeskWinManager.unregisterActiveWindow(0);
|
||||||
} else {
|
} else {
|
||||||
widget.onClose?.call();
|
widget.onClose?.call();
|
||||||
final frame = await WindowController.fromWindowId(windowId!).getFrame();
|
|
||||||
await WindowController.fromWindowId(windowId!).hide();
|
await WindowController.fromWindowId(windowId!).hide();
|
||||||
rustDeskWinManager
|
rustDeskWinManager
|
||||||
.call(WindowType.Main, kWindowEventHide, {"id": windowId!});
|
.call(WindowType.Main, kWindowEventHide, {"id": windowId!});
|
||||||
final frame2 = await WindowController.fromWindowId(windowId!).getFrame();
|
|
||||||
print("${frame} ---hide--> ${frame2}");
|
|
||||||
}
|
}
|
||||||
super.onWindowClose();
|
super.onWindowClose();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user