fix: acquire the Inhitbit lock only when !is_server_running()

Signed-off-by: Steve3184 <77789906+Steve3184@users.noreply.github.com>
This commit is contained in:
Steve3184 2026-03-01 21:16:15 +08:00
parent 66e0e0c9e3
commit c998f96c31

View file

@ -1034,7 +1034,7 @@ pub fn get_capturables() -> Result<Vec<PipeWireCapturable>, Box<dyn Error>> {
if rdp_connection.is_none() {
let (conn, fd, streams, session, is_support_restore_token) = request_remote_desktop(false)?;
let conn = Arc::new(conn);
let inhibit_path = request_inhibit(&conn);
let inhibit_path = if !is_server_running() { request_inhibit(&conn) } else { None };
let rdp_info = RdpSessionInfo {
conn,