mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-24 12:29:04 +08:00
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 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 {
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user