[feat] add macOS and mobile resolution controls with disconnect restore

This commit is contained in:
dijunkun
2026-11-11 11:02:41 +08:00
parent a3159b198e
commit 34b59de15d
50 changed files with 1086 additions and 36 deletions
@@ -220,6 +220,7 @@ void GuiRuntime::HandleServerControllerDisconnected(
windows_rdp_handoff_connected_->store(has_connected_controller,
std::memory_order_relaxed);
#endif
if (!has_connected_controller) ++display_resolution_epoch_;
}
clipboard_.ForgetWeb(remote_id);
if (has_connected_controller) {
@@ -269,6 +270,9 @@ void GuiRuntime::HandleScreenLock() {
std::unique_lock lock(connection_status_mutex_);
if (!disconnect_lock_.TakeRequest(config_center_->IsLockOnDisconnect()))
return;
// Restore while the interactive desktop is still available. This forced
// path does not reacquire connection_status_mutex_.
RestoreHostDisplayResolutions(true);
#if defined(_WIN32) || defined(__APPLE__) || (defined(__linux__) && !defined(__OHOS__))
if (LockScreen()) LOG_INFO("Requested screen lock after last controller disconnected");
#endif