Feat: Follow remote cursor and window focus | Auto display switch (#7717)

* feat: auto switch display on follow remote cursor

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* feat: auto switch display on follow remote window focus

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* fix build and remove unused imports

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* fix build

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* fix build

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* fix linux get_focused_window_id

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* lock show remote cursor when follow remote cursor is enabled

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* fix config

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* prevent auto display switch on show all display and displays as individual windows

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* fix options

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* fix options

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* remove unused function

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* remove unwraps and improve iterations

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* set updateCursorPos to false to avoid interrupting remote cursor

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* update lang

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* fix web build

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* update checks for options and enable in view mode

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* use focused display index for window focus service

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* use window center for windows display focused

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* remove unused imports

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* fix build

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* use libxdo instead of xdotool

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* fix multi monitor check

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* enable show cursor when follow cursor is default

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* remove show_all_displays,use runtime state instead

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* fix show cursor lock state on default

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* remove view mode with follow options

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* fix build

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* use separate message for follow current display

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* fix options

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* sciter support for follow remote cursor and window

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* add check for ui session handlers count

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* use cached displays and remove peer info write

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* No follow options when show all displays

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* No follow options when multi ui session

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* turn off follow options when not used|prevent msgs

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* use window center for switch in linux

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* use subbed display count to prevent switch msgs

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* fix build

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* fix web build

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* move subbed displays count

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* fix build

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* add noperms for window focus

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* add subscribe for window focus

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* remove window_focus message and unsub on multi ui

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

* add multi ui session field

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>

---------

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
Sahil Yeole
2024-04-25 10:56:02 +05:30
committed by GitHub
parent 43a0a4f8e0
commit 3811f41076
66 changed files with 597 additions and 26 deletions

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -604,5 +604,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", "打开 Web 控制台以执行更多操作"),
("allow-only-conn-window-open-tip", "仅当 RustDesk 窗口打开时允许连接"),
("no_need_privacy_mode_no_physical_displays_tip", "没有物理显示器,没必要使用隐私模式。"),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", "Více na webové konzoli"),
("allow-only-conn-window-open-tip", "Povolit připojení pouze v případě, že je otevřené okno RustDesk"),
("no_need_privacy_mode_no_physical_displays_tip", "Žádné fyzické displeje, není třeba používat režim soukromí."),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", "Mehr über Webkonsole"),
("allow-only-conn-window-open-tip", "Verbindung nur zulassen, wenn das RustDesk-Fenster geöffnet ist"),
("no_need_privacy_mode_no_physical_displays_tip", "Keine physischen Bildschirme; keine Notwendigkeit, den Datenschutzmodus zu verwenden."),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -222,5 +222,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", "More on web console"),
("allow-only-conn-window-open-tip", "Only allow connection if RustDesk window is open"),
("no_need_privacy_mode_no_physical_displays_tip", "No physical displays, no need to use the privacy mode."),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", "Más en consola web"),
("allow-only-conn-window-open-tip", "Permitir la conexión solo si la ventana RusDesk está abierta"),
("no_need_privacy_mode_no_physical_displays_tip", "No hay pantallas físicas, no es necesario usar el modo privado."),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", "اطلاعات بیشتر در کنسول وب"),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -602,5 +602,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", "Više na web konzoli"),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", "Altre info sulla console web"),
("allow-only-conn-window-open-tip", "Consenti la connessione solo se la finestra RustDesk è aperta"),
("no_need_privacy_mode_no_physical_displays_tip", "Nessun display fisico, nessuna necessità di usare la modalità privacy."),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", "Vairāk par tīmekļa konsoli"),
("allow-only-conn-window-open-tip", "Atļaut savienojumu tikai tad, ja ir atvērts RustDesk logs"),
("no_need_privacy_mode_no_physical_displays_tip", "Nav fizisku displeju, nav jāizmanto privātuma režīms."),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", "Meer over de webconsole"),
("allow-only-conn-window-open-tip", "Alleen verbindingen toestaan als het RustDesk-venster geopend is"),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", "Więcej w konsoli web"),
("allow-only-conn-window-open-tip", "Zezwalaj na połączenie tylko wtedy, gdy okno RustDesk jest otwarte"),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", "Больше в веб-консоли"),
("allow-only-conn-window-open-tip", "Разрешать подключение только при открытом окне RustDesk"),
("no_need_privacy_mode_no_physical_displays_tip", "Физические дисплеи отсутствуют, нет необходимости использовать режим конфиденциальности."),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", "Viac na webovej konzole"),
("allow-only-conn-window-open-tip", "Povoliť pripojenie iba vtedy, ak je otvorené okno aplikácie RustDesk"),
("no_need_privacy_mode_no_physical_displays_tip", "Žiadne fyzické displeje, nie je potrebné používať režim ochrany osobných údajov."),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", "打開 Web 控制台以進行更多操作"),
("allow-only-conn-window-open-tip", "只在 RustDesk 視窗開啟時允許連接"),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", "Детальніше про веб-консоль"),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}

View File

@@ -603,5 +603,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("ab_web_console_tip", ""),
("allow-only-conn-window-open-tip", ""),
("no_need_privacy_mode_no_physical_displays_tip", ""),
("Follow remote cursor", ""),
("Follow remote window focus", ""),
].iter().cloned().collect();
}