Skip to content

Commit

Permalink
use Option<bool> to windows apis
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Jan 9, 2025
1 parent 5cd38e2 commit aa9e906
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions frontends/rioterm/src/router/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,19 @@ pub fn create_window_builder(
#[cfg(target_os = "windows")]
{
use rio_window::platform::windows::WindowAttributesExtWindows;
if !config.window.windows_with_undecorated_shadow {
if let Some(use_undecorated_shadow) =
config.window.windows_use_undecorated_shadow
{
window_builder = window_builder
.with_undecorated_shadow(config.window.windows_with_undecorated_shadow);
.with_undecorated_shadow(config.window.use_undecorated_shadow);
}

if let Some(with_no_redirection_bitmap) =
config.window.windows_with_no_redirection_bitmap
if let Some(use_no_redirection_bitmap) =
config.window.windows_use_no_redirection_bitmap
{
// This sets WS_EX_NOREDIRECTIONBITMAP.
window_builder = window_builder
.with_no_redirection_bitmap(config.window.with_no_redirection_bitmap);
.with_no_redirection_bitmap(config.window.use_no_redirection_bitmap);
}
}

Expand Down
6 changes: 3 additions & 3 deletions rio-backend/src/config/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ pub struct Window {
pub initial_title: Option<String>,
#[serde(
rename = "windows-use-undecorated-shadow",
default = "default_bool_true"
default = "Option::default"
)]
pub windows_use_undecorated_shadow: bool,
pub windows_use_undecorated_shadow: Option<bool>,
#[serde(
rename = "windows-use-no-redirection-bitmap",
default = "Option::default"
Expand All @@ -100,7 +100,7 @@ impl Default for Window {
macos_use_unified_titlebar: false,
macos_use_shadow: true,
initial_title: None,
windows_use_undecorated_shadow: true,
windows_use_undecorated_shadow: None,
windows_use_no_redirection_bitmap: None,
windows_corner_preference: None,
}
Expand Down

0 comments on commit aa9e906

Please sign in to comment.