Skip to content

Commit

Permalink
fix(Windows): fix build regression when tray feature is used (#618)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Nov 8, 2022
1 parent c37bc7d commit 081664d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .changes/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"gitSiteUrl": "https://github.com/tauri-apps/tao/",
"timeout": 3600000,
"additionalBumpTypes": ["housekeeping"],
"additionalBumpTypes": [
"housekeeping"
],
"pkgManagers": {
"rust": {
"version": true,
Expand Down Expand Up @@ -35,7 +37,7 @@
],
"publish": [
{
"command": "cargo package --allow-dirty",
"command": "cargo package --allow-dirty --features tray",
"dryRunCommand": true
},
{
Expand Down Expand Up @@ -78,4 +80,4 @@
"manager": "rust"
}
}
}
}
5 changes: 5 additions & 0 deletions .changes/fix-compile-regression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tao": "patch"
---

On Windows, fix compliation regression introduced in 0.15.1 when `tray` feature is active
3 changes: 3 additions & 0 deletions src/platform_impl/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,16 @@ impl DeviceId {
#[non_exhaustive]
#[derive(Debug)]
pub enum OsError {
#[allow(unused)]
CreationError(&'static str),
IoError(std::io::Error),
}
impl std::error::Error for OsError {}

impl std::fmt::Display for OsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
OsError::CreationError(e) => f.pad(e),
OsError::IoError(e) => f.pad(&e.to_string()),
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/windows/system_tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ unsafe extern "system" fn tray_subclass_proc(
let mut subclass_input = &mut *(subclass_input_ptr);

if msg == WM_DESTROY {
Box::from_raw(subclass_input_ptr);
drop(Box::from_raw(subclass_input_ptr));
}

if msg == WM_USER_UPDATE_TRAYMENU {
Expand Down

0 comments on commit 081664d

Please sign in to comment.