This commit is contained in:
Piotr Osiewicz 2025-08-18 19:45:48 +02:00
parent b4ef6ec60b
commit bf577383a5
2 changed files with 44 additions and 47 deletions

View file

@ -701,8 +701,8 @@ impl WindowsWindowInner {
// Fix auto hide taskbar not showing. This solution is based on the approach // Fix auto hide taskbar not showing. This solution is based on the approach
// used by Chrome. However, it may result in one row of pixels being obscured // used by Chrome. However, it may result in one row of pixels being obscured
// in our client area. But as Chrome says, "there seems to be no better solution." // in our client area. But as Chrome says, "there seems to be no better solution."
if is_maximized { if is_maximized
if let Some(ref taskbar_position) = self && let Some(ref taskbar_position) = self
.state .state
.borrow() .borrow()
.system_settings .system_settings
@ -726,7 +726,6 @@ impl WindowsWindowInner {
} }
} }
} }
}
Some(0) Some(0)
} }
@ -1125,15 +1124,14 @@ impl WindowsWindowInner {
// lParam is a pointer to a string that indicates the area containing the system parameter // lParam is a pointer to a string that indicates the area containing the system parameter
// that was changed. // that was changed.
let parameter = PCWSTR::from_raw(lparam.0 as _); let parameter = PCWSTR::from_raw(lparam.0 as _);
if unsafe { !parameter.is_null() && !parameter.is_empty() } { if unsafe { !parameter.is_null() && !parameter.is_empty() }
if let Some(parameter_string) = unsafe { parameter.to_string() }.log_err() { && let Some(parameter_string) = unsafe { parameter.to_string() }.log_err()
{
log::info!("System settings changed: {}", parameter_string); log::info!("System settings changed: {}", parameter_string);
match parameter_string.as_str() { match parameter_string.as_str() {
"ImmersiveColorSet" => { "ImmersiveColorSet" => {
let new_appearance = system_appearance() let new_appearance = system_appearance()
.context( .context("unable to get system appearance when handling ImmersiveColorSet")
"unable to get system appearance when handling ImmersiveColorSet",
)
.log_err()?; .log_err()?;
let mut lock = self.state.borrow_mut(); let mut lock = self.state.borrow_mut();
if new_appearance != lock.appearance { if new_appearance != lock.appearance {
@ -1148,7 +1146,6 @@ impl WindowsWindowInner {
_ => {} _ => {}
} }
} }
}
Some(0) Some(0)
} }

View file

@ -821,15 +821,15 @@ fn file_save_dialog(
window: Option<HWND>, window: Option<HWND>,
) -> Result<Option<PathBuf>> { ) -> Result<Option<PathBuf>> {
let dialog: IFileSaveDialog = unsafe { CoCreateInstance(&FileSaveDialog, None, CLSCTX_ALL)? }; let dialog: IFileSaveDialog = unsafe { CoCreateInstance(&FileSaveDialog, None, CLSCTX_ALL)? };
if !directory.to_string_lossy().is_empty() { if !directory.to_string_lossy().is_empty()
if let Some(full_path) = directory.canonicalize().log_err() { && let Some(full_path) = directory.canonicalize().log_err()
{
let full_path = SanitizedPath::from(full_path); let full_path = SanitizedPath::from(full_path);
let full_path_string = full_path.to_string(); let full_path_string = full_path.to_string();
let path_item: IShellItem = let path_item: IShellItem =
unsafe { SHCreateItemFromParsingName(&HSTRING::from(full_path_string), None)? }; unsafe { SHCreateItemFromParsingName(&HSTRING::from(full_path_string), None)? };
unsafe { dialog.SetFolder(&path_item).log_err() }; unsafe { dialog.SetFolder(&path_item).log_err() };
} }
}
if let Some(suggested_name) = suggested_name { if let Some(suggested_name) = suggested_name {
unsafe { dialog.SetFileName(&HSTRING::from(suggested_name)).log_err() }; unsafe { dialog.SetFileName(&HSTRING::from(suggested_name)).log_err() };