Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden committed Apr 18, 2024
1 parent fa89ffd commit b1cfc06
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 90 deletions.
182 changes: 110 additions & 72 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ anyhow = "1"
indexmap = "2.2.3"
log = "0.4.20"
once_cell = "1.18.0"
rust-ini = "0.20.0"
rust-ini = "0.21.0"
simple-logging = "2.0.2"
xml = "0.8.10"

[dependencies.windows]
version = "0.54.0"
version = "0.56.0"
features = [
"Win32_Foundation",
"Win32_UI_WindowsAndMessaging",
Expand Down
13 changes: 8 additions & 5 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl App {
}
0 => break,
_ => unsafe {
TranslateMessage(&message);
let _ = TranslateMessage(&message);
DispatchMessageW(&message);
},
}
Expand Down Expand Up @@ -226,8 +226,9 @@ impl App {
} else if hotkey_id == app.config.switch_apps_hotkey.id {
app.switch_apps(reverse)?;
unsafe {
RedrawWindow(hwnd, None, HRGN::default(), RDW_ERASE | RDW_INVALIDATE)
};
let _ =
RedrawWindow(hwnd, None, HRGN::default(), RDW_ERASE | RDW_INVALIDATE);
}
if let Some(state) = &app.switch_apps_state {
app.painter.paint(state);
}
Expand Down Expand Up @@ -416,7 +417,7 @@ impl App {
let _ = GetCursorPos(&mut cursor);

let hmonitor = MonitorFromPoint(cursor, MONITOR_DEFAULTTONEAREST);
GetMonitorInfoW(hmonitor, &mut mi);
let _ = GetMonitorInfoW(hmonitor, &mut mi);
}

let monitor_rect = mi.rcMonitor;
Expand Down Expand Up @@ -498,7 +499,9 @@ impl App {
for (hicon, _) in state.apps {
let _ = unsafe { DestroyIcon(hicon) };
}
unsafe { ShowWindow(hwnd, SW_HIDE) };
unsafe {
let _ = ShowWindow(hwnd, SW_HIDE);
}
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/foreground.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ impl Drop for ForegroundWatcher {
fn drop(&mut self) {
debug!("foreground watcher destoryed");
if !self.hook.is_invalid() {
unsafe { UnhookWinEvent(self.hook) };
unsafe {
let _ = UnhookWinEvent(self.hook);
}
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/painter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ impl GdiAAPainter {
self.height = height;
self.size = size;

DeleteDC(self.mem_hdc);
DeleteObject(self.mem_map);
DeleteDC(self.scaled_hdc);
DeleteObject(self.scaled_map);
let _ = DeleteDC(self.mem_hdc);
let _ = DeleteObject(self.mem_map);
let _ = DeleteDC(self.scaled_hdc);
let _ = DeleteObject(self.scaled_map);

let hdc = GetDC(self.hwnd);
let mem_dc = CreateCompatibleDC(hdc);
Expand Down Expand Up @@ -120,7 +120,7 @@ impl GdiAAPainter {
self.paint0(state);
unsafe {
SetStretchBltMode(self.mem_hdc, HALFTONE);
StretchBlt(
let _ = StretchBlt(
self.mem_hdc,
0,
0,
Expand Down Expand Up @@ -151,7 +151,7 @@ impl GdiAAPainter {
0,
SRCCOPY,
);
EndPaint(self.hwnd, &ps);
let _ = EndPaint(self.hwnd, &ps);
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/trayicon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ impl TrayIcon {
impl Drop for TrayIcon {
fn drop(&mut self) {
debug!("trayicon destroyed");
unsafe { Shell_NotifyIconW(NIM_DELETE, &self.data) };
unsafe {
let _ = Shell_NotifyIconW(NIM_DELETE, &self.data);
}
}
}
4 changes: 2 additions & 2 deletions src/utils/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub fn get_window_exe(hwnd: HWND) -> Option<String> {
pub fn set_foreground_window(hwnd: HWND) {
unsafe {
if is_iconic_window(hwnd) {
ShowWindow(hwnd, SW_RESTORE);
let _ = ShowWindow(hwnd, SW_RESTORE);
}
if hwnd == get_foreground_window() {
return;
Expand All @@ -132,7 +132,7 @@ pub fn set_foreground_window(hwnd: HWND) {
let hwnd_console = GetConsoleWindow();
let _ = SetWindowPos(hwnd_console, None, 0, 0, 0, 0, SWP_NOZORDER);
let _ = FreeConsole();
SetForegroundWindow(hwnd);
let _ = SetForegroundWindow(hwnd);
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion tools/inspect-windows/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ indexmap = "2.2.3"
window-switcher = { path = "../.."}

[dependencies.windows]
version = "0.54.0"
version = "0.56.0"
features = [
"Win32_Foundation",
"Win32_UI_WindowsAndMessaging",
Expand Down

0 comments on commit b1cfc06

Please sign in to comment.