macos, periodically check if current display is changed
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
f71d4e9e81
commit
b8b3e99602
4 changed files with 14 additions and 7 deletions
|
|
@ -577,6 +577,14 @@ fn run(sp: GenericService) -> ResultType<()> {
|
|||
if last_check_displays.elapsed().as_millis() > 1000 {
|
||||
last_check_displays = now;
|
||||
|
||||
// Capturer on macos does not return Err event the solution is changed.
|
||||
#[cfg(target_os = "macos")]
|
||||
if check_display_changed(c.ndisplay, c.current, c.width, c.height) {
|
||||
log::info!("Displays changed");
|
||||
*SWITCH.lock().unwrap() = true;
|
||||
bail!("SWITCH");
|
||||
}
|
||||
|
||||
if let Some(msg_out) = check_displays_changed() {
|
||||
sp.send(msg_out);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue