fix: setMovable only on macos (#8261)

* fix: setMovable only on macos

Signed-off-by: fufesou <linlong1266@gmail.com>

* Refact and comments

Signed-off-by: fufesou <linlong1266@gmail.com>

* comments

Signed-off-by: fufesou <linlong1266@gmail.com>

* Refact comments

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2024-06-05 14:52:56 +08:00
committed by GitHub
parent ce1dac3b86
commit a84b9bd2c8
3 changed files with 34 additions and 3 deletions

View File

@ -95,7 +95,9 @@ Future<void> main(List<String> args) async {
desktopType = DesktopType.main;
await windowManager.ensureInitialized();
windowManager.setPreventClose(true);
windowManager.setMovable(false);
if (isMacOS) {
disableWindowMovable(kWindowId);
}
runMainApp(true);
}
}
@ -168,7 +170,9 @@ void runMultiWindow(
final title = getWindowName();
// set prevent close to true, we handle close event manually
WindowController.fromWindowId(kWindowId!).setPreventClose(true);
WindowController.fromWindowId(kWindowId!).setMovable(false);
if (isMacOS) {
disableWindowMovable(kWindowId);
}
late Widget widget;
switch (appType) {
case kAppTypeDesktopRemote: