mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-08-20 05:21:36 +08:00
fix macos minisized after checking permission
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@ -222,7 +222,7 @@ class MyTheme {
|
|||||||
//tooltip
|
//tooltip
|
||||||
static TooltipThemeData tooltipTheme() {
|
static TooltipThemeData tooltipTheme() {
|
||||||
return TooltipThemeData(
|
return TooltipThemeData(
|
||||||
waitDuration: Duration(seconds: 1, milliseconds: 500),
|
waitDuration: Duration(seconds: 1, milliseconds: 500),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1554,7 +1554,7 @@ Future<bool> restoreWindowPosition(WindowType type,
|
|||||||
bool isRemotePeerPos = false;
|
bool isRemotePeerPos = false;
|
||||||
String? pos;
|
String? pos;
|
||||||
// No need to check mainGetLocalBoolOptionSync(kOptionOpenNewConnInTabs)
|
// No need to check mainGetLocalBoolOptionSync(kOptionOpenNewConnInTabs)
|
||||||
// Though "open in tabs" is true and the new window restore peer position, it's ok.
|
// Though "open in tabs" is true and the new window restore peer position, it's ok.
|
||||||
if (type == WindowType.RemoteDesktop && windowId != null && peerId != null) {
|
if (type == WindowType.RemoteDesktop && windowId != null && peerId != null) {
|
||||||
// If the restore position is called by main window, and the peer id is not null
|
// If the restore position is called by main window, and the peer id is not null
|
||||||
// then we may need to get the position by reading the peer config.
|
// then we may need to get the position by reading the peer config.
|
||||||
@ -2281,10 +2281,18 @@ void onCopyFingerprint(String value) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<bool> callMainCheckSuperUserPermission() async {
|
||||||
|
bool checked = await bind.mainCheckSuperUserPermission();
|
||||||
|
if (Platform.isMacOS) {
|
||||||
|
await windowManager.show();
|
||||||
|
}
|
||||||
|
return checked;
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> start_service(bool is_start) async {
|
Future<void> start_service(bool is_start) async {
|
||||||
bool checked = !bind.mainIsInstalled() ||
|
bool checked = !bind.mainIsInstalled() ||
|
||||||
!Platform.isMacOS ||
|
!Platform.isMacOS ||
|
||||||
await bind.mainCheckSuperUserPermission();
|
await callMainCheckSuperUserPermission();
|
||||||
if (checked) {
|
if (checked) {
|
||||||
bind.mainSetOption(key: "stop-service", value: is_start ? "" : "Y");
|
bind.mainSetOption(key: "stop-service", value: is_start ? "" : "Y");
|
||||||
}
|
}
|
||||||
|
@ -1832,13 +1832,10 @@ Widget _lock(
|
|||||||
Text(translate(label)).marginOnly(left: 5),
|
Text(translate(label)).marginOnly(left: 5),
|
||||||
]).marginSymmetric(vertical: 2)),
|
]).marginSymmetric(vertical: 2)),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
bool checked = await bind.mainCheckSuperUserPermission();
|
bool checked = await callMainCheckSuperUserPermission();
|
||||||
if (checked) {
|
if (checked) {
|
||||||
onUnlock();
|
onUnlock();
|
||||||
}
|
}
|
||||||
if (Platform.isMacOS) {
|
|
||||||
await windowManager.show();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
).marginSymmetric(horizontal: 2, vertical: 4),
|
).marginSymmetric(horizontal: 2, vertical: 4),
|
||||||
).marginOnly(left: _kCardLeftMargin),
|
).marginOnly(left: _kCardLeftMargin),
|
||||||
|
Reference in New Issue
Block a user