opt: add debug output

This commit is contained in:
Kingtous 2022-11-09 17:23:18 +08:00
parent 200d8dc0f5
commit 7fe42e312f
2 changed files with 2 additions and 6 deletions

View File

@ -1037,7 +1037,7 @@ Future<void> saveWindowPosition(WindowType type, {int? windowId}) async {
final isMaximized = await wc.isMaximized();
final pos = LastWindowPosition(
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>()
.setString(kWindowPrefix + type.name, pos.toString());
break;
@ -1175,7 +1175,7 @@ Future<bool> restoreWindowPosition(WindowType type, {int? windowId}) async {
await _adjustRestoreMainWindowSize(lpos.width, lpos.height);
final offset = await _adjustRestoreMainWindowOffset(
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) {
await wc.center();
} else {

View File

@ -500,19 +500,15 @@ class WindowActionPanelState extends State<WindowActionPanel>
@override
void onWindowClose() async {
print("onWindowClose");
// hide window on close
if (widget.isMainWindow) {
await windowManager.hide();
rustDeskWinManager.unregisterActiveWindow(0);
} else {
widget.onClose?.call();
final frame = await WindowController.fromWindowId(windowId!).getFrame();
await WindowController.fromWindowId(windowId!).hide();
rustDeskWinManager
.call(WindowType.Main, kWindowEventHide, {"id": windowId!});
final frame2 = await WindowController.fromWindowId(windowId!).getFrame();
print("${frame} ---hide--> ${frame2}");
}
super.onWindowClose();
}