Skip to content

Commit

Permalink
don't panic on notify error (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-pro committed Feb 26, 2024
1 parent 79c56cc commit f5e4d2f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wsl2-dns-agent"
version = "0.3.5"
version = "0.3.6"
edition = "2021"
license = "GPL-3.0"
description = "An agent that automatically patches your WSL2 DNS configuration for users of Cisco AnyConnect (or similar VPNs)"
Expand All @@ -18,7 +18,7 @@ serde = { version = "1.0.137", features = ["derive"] }
simplelog = "0.12.0"
thiserror = "1.0.31"
toml = "0.5.9"
win32-utils = { git = "https://github.com/jacob-pro/win32-utils", features = ["net", "window", "instance"] }
win32-utils = { git = "https://github.com/jacob-pro/win32-utils", features = ["net", "window", "instance"], rev = "055c60695dbc4d300f3caaacec25ae82415fa545" }

[dependencies.windows]
version = "0.37.0"
Expand Down
1 change: 1 addition & 0 deletions src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pub fn start_runner(config: Config, rx: mpsc::Receiver<RunReason>, tray: TrayHan
}

#[derive(Debug, Error)]
#[allow(clippy::enum_variant_names)]
enum Error {
#[error("Win32 DNS error: {0}")]
Dns(
Expand Down
3 changes: 2 additions & 1 deletion src/tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ impl TrayProperties {
.copy_to_wchar_buffer(&mut self.icon.szInfoTitle)
.unwrap();
message.copy_to_wchar_buffer(&mut self.icon.szInfo).unwrap();
Shell_NotifyIconW(NIM_MODIFY, &self.icon).ok().unwrap();
// https://github.com/jacob-pro/wsl2-dns-agent/issues/9
Shell_NotifyIconW(NIM_MODIFY, &self.icon);
}

unsafe fn show_tray_menu(&self) {
Expand Down

0 comments on commit f5e4d2f

Please sign in to comment.