Evan's Blog
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.

上游 GitHub
READ-ONLY MIRROR

README、源码与 Release 已保存到本站;源码视图固定到 commit bd87fa1e。

main/ root / src/bin
bd87fa1e· 固定源码快照
src/bin/sbms-tray.rs1.2 KB
1#![windows_subsystem = "windows"]
2
3use sbms::launch_broker::{self, LaunchDisposition};
4
5fn 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
19fn 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