fix: macos tab drag (#8242)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
parent
32346c23e0
commit
32ef5f47f8
@ -396,6 +396,16 @@ class DesktopTab extends StatelessWidget {
|
||||
}
|
||||
: null,
|
||||
onPanStart: (_) => startDragging(isMainWindow),
|
||||
onPanCancel: () {
|
||||
if (isMacOS) {
|
||||
setMovable(isMainWindow, false);
|
||||
}
|
||||
},
|
||||
onPanEnd: (_) {
|
||||
if (isMacOS) {
|
||||
setMovable(isMainWindow, false);
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Offstage(
|
||||
@ -786,6 +796,14 @@ void startDragging(bool isMainWindow) {
|
||||
}
|
||||
}
|
||||
|
||||
void setMovable(bool isMainWindow, bool movable) {
|
||||
if (isMainWindow) {
|
||||
windowManager.setMovable(movable);
|
||||
} else {
|
||||
WindowController.fromWindowId(kWindowId!).setMovable(movable);
|
||||
}
|
||||
}
|
||||
|
||||
/// return true -> window will be maximize
|
||||
/// return false -> window will be unmaximize
|
||||
Future<bool> toggleMaximize(bool isMainWindow) async {
|
||||
|
@ -95,6 +95,7 @@ Future<void> main(List<String> args) async {
|
||||
desktopType = DesktopType.main;
|
||||
await windowManager.ensureInitialized();
|
||||
windowManager.setPreventClose(true);
|
||||
windowManager.setMovable(false);
|
||||
runMainApp(true);
|
||||
}
|
||||
}
|
||||
@ -167,6 +168,7 @@ 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);
|
||||
late Widget widget;
|
||||
switch (appType) {
|
||||
case kAppTypeDesktopRemote:
|
||||
|
@ -335,7 +335,7 @@ packages:
|
||||
description:
|
||||
path: "."
|
||||
ref: HEAD
|
||||
resolved-ref: bfbed668445edaea0626fb7d6b8b2aab3a444b17
|
||||
resolved-ref: 3535741662c5b7529e182227a277a8551aed3398
|
||||
url: "https://github.com/rustdesk-org/rustdesk_desktop_multi_window"
|
||||
source: git
|
||||
version: "0.1.0"
|
||||
|
Loading…
x
Reference in New Issue
Block a user