EvanZhu0721 / 公开仓库
SBMS
SBMS complete the calculation rules for the default logical desktop topology relationship and the physical dimensions of the displays in the Windows multi-screen collaboration system.
src/bin/sbms-tray.rs1.2 KB
1
#![windows_subsystem = "windows"]2
3
use sbms::launch_broker::{self, LaunchDisposition};4
5
fn main() {6
if let Err(error) = run() {7
sbms::diagnostics::log(8
sbms::diagnostics::Level::Error,9
"tray",10
"startup",11
None,12
error.to_string(),13
);14
launch_broker::show_launch_error(&*error);15
std::process::exit(1);16
}17
}18
19
fn run() -> Result<(), Box<dyn std::error::Error>> {20
if let Err(error) = sbms::diagnostics::init() {21
eprintln!("warning: diagnostics initialization failed: {error}");22
}23
sbms::diagnostics::log(24
sbms::diagnostics::Level::Info,25
"tray",26
"process-start",27
None,28
"SBMS tray process started",29
);30
unsafe {31
windows::Win32::UI::HiDpi::SetProcessDpiAwarenessContext(32
windows::Win32::UI::HiDpi::DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2,33
)34
}?;35
let open_requested = launch_broker::tray_open_requested(std::env::args_os().skip(1))?;36
match launch_broker::route_tray(open_requested)? {37
LaunchDisposition::Exit => Ok(()),38
LaunchDisposition::RunHere(instance) => sbms::ui::run_host(instance, open_requested),39
}40
}41