fn main() {
println!("Polling the window under the pointer every second — move it to test.");
std::thread::spawn(|| {
loop {
let context = openlogi_hook::pointer_context();
match context.app {
Some(app) => println!("{:?}\t{}", context.target, app.id),
None => println!("{:?}", context.target),
}
std::thread::sleep(std::time::Duration::from_secs(1));
}
});
#[cfg(target_os = "macos")]
if let Some(mtm) = objc2::MainThreadMarker::new() {
objc2_app_kit::NSApplication::sharedApplication(mtm).run();
}
loop {
std::thread::park();
}
}