not run get window focus if no multiple displays (#9174)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages 2024-08-26 10:37:35 +08:00 committed by GitHub
parent 48aec6484c
commit 5abe42f66c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -385,6 +385,9 @@ fn run_cursor(sp: MouseCursorService, state: &mut StateCursor) -> ResultType<()>
fn run_window_focus(sp: EmptyExtraFieldService, state: &mut StateWindowFocus) -> ResultType<()> {
let displays = super::display_service::get_sync_displays();
if displays.len() <= 1 {
return Ok(());
}
let disp_idx = crate::get_focused_display(displays);
if let Some(disp_idx) = disp_idx.map(|id| id as i32) {
if state.is_changed(disp_idx) {