Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

feat: rename `show_on_top` state option -> `shown_on_top`

Lars Bergerd6150d13a7d0
diff --git a/packages/wm/src/app_command.rs b/packages/wm/src/app_command.rs
index de6cf346..220cce8c 100644
--- a/packages/wm/src/app_command.rs
+++ b/packages/wm/src/app_command.rs
@@ -181,14 +181,14 @@ pub enum InvokeCommand {
Resize(InvokeResizeCommand),
SetFloating {
#[clap(long, default_missing_value = "true", require_equals = true, num_args = 0..=1)]
- show_on_top: Option<bool>,
+ shown_on_top: Option<bool>,
#[clap(long, default_missing_value = "true", require_equals = true, num_args = 0..=1)]
centered: Option<bool>,
},
SetFullscreen {
#[clap(long, default_missing_value = "true", require_equals = true, num_args = 0..=1)]
- show_on_top: Option<bool>,
+ shown_on_top: Option<bool>,
#[clap(long, default_missing_value = "true", require_equals = true, num_args = 0..=1)]
maximized: Option<bool>,
@@ -204,14 +204,14 @@ pub enum InvokeCommand {
},
ToggleFloating {
#[clap(long, default_missing_value = "true", require_equals = true, num_args = 0..=1)]
- show_on_top: Option<bool>,
+ shown_on_top: Option<bool>,
#[clap(long, default_missing_value = "true", require_equals = true, num_args = 0..=1)]
centered: Option<bool>,
},
ToggleFullscreen {
#[clap(long, default_missing_value = "true", require_equals = true, num_args = 0..=1)]
- show_on_top: Option<bool>,
+ shown_on_top: Option<bool>,
#[clap(long, default_missing_value = "true", require_equals = true, num_args = 0..=1)]
maximized: Option<bool>,
@@ -333,7 +333,7 @@ impl InvokeCommand {
}
InvokeCommand::SetFloating {
centered,
- show_on_top,
+ shown_on_top,
} => match subject_container.as_window_container() {
Ok(window) => {
let floating_defaults =
@@ -343,8 +343,8 @@ impl InvokeCommand {
window.clone(),
WindowState::Floating(FloatingStateConfig {
centered: centered.unwrap_or(floating_defaults.centered),
- show_on_top: show_on_top
- .unwrap_or(floating_defaults.show_on_top),
+ shown_on_top: shown_on_top
+ .unwrap_or(floating_defaults.shown_on_top),
}),
state,
config,
@@ -354,7 +354,7 @@ impl InvokeCommand {
},
InvokeCommand::SetFullscreen {
maximized,
- show_on_top,
+ shown_on_top,
remove_title_bar,
} => match subject_container.as_window_container() {
Ok(window) => {
@@ -366,8 +366,8 @@ impl InvokeCommand {
WindowState::Fullscreen(FullscreenStateConfig {
maximized: maximized
.unwrap_or(fullscreen_defaults.maximized),
- show_on_top: show_on_top
- .unwrap_or(fullscreen_defaults.show_on_top),
+ shown_on_top: shown_on_top
+ .unwrap_or(fullscreen_defaults.shown_on_top),
remove_title_bar: remove_title_bar
.unwrap_or(fullscreen_defaults.remove_title_bar),
}),
@@ -401,7 +401,7 @@ impl InvokeCommand {
}
InvokeCommand::ToggleFloating {
centered,
- show_on_top,
+ shown_on_top,
} => match subject_container.as_window_container() {
Ok(window) => {
let floating_defaults =
@@ -409,8 +409,8 @@ impl InvokeCommand {
let target_state = WindowState::Floating(FloatingStateConfig {
centered: centered.unwrap_or(floating_defaults.centered),
- show_on_top: show_on_top
- .unwrap_or(floating_defaults.show_on_top),
+ shown_on_top: shown_on_top
+ .unwrap_or(floating_defaults.shown_on_top),
});
update_window_state(
@@ -424,7 +424,7 @@ impl InvokeCommand {
},
InvokeCommand::ToggleFullscreen {
maximized,
- show_on_top,
+ shown_on_top,
remove_title_bar,
} => match subject_container.as_window_container() {
Ok(window) => {
@@ -435,8 +435,8 @@ impl InvokeCommand {
WindowState::Fullscreen(FullscreenStateConfig {
maximized: maximized
.unwrap_or(fullscreen_defaults.maximized),
- show_on_top: show_on_top
- .unwrap_or(fullscreen_defaults.show_on_top),
+ shown_on_top: shown_on_top
+ .unwrap_or(fullscreen_defaults.shown_on_top),
remove_title_bar: remove_title_bar
.unwrap_or(fullscreen_defaults.remove_title_bar),
});
diff --git a/packages/wm/src/common/platform/native_window.rs b/packages/wm/src/common/platform/native_window.rs
index 7c2afd68..95d7c4d5 100644
--- a/packages/wm/src/common/platform/native_window.rs
+++ b/packages/wm/src/common/platform/native_window.rs
@@ -479,8 +479,8 @@ impl NativeWindow {
// Whether the window should be shown above all other windows.
let z_order = match state {
- WindowState::Floating(config) if config.show_on_top => HWND_TOPMOST,
- WindowState::Fullscreen(config) if config.show_on_top => {
+ WindowState::Floating(config) if config.shown_on_top => HWND_TOPMOST,
+ WindowState::Fullscreen(config) if config.shown_on_top => {
HWND_TOPMOST
}
_ => HWND_NOTOPMOST,
diff --git a/packages/wm/src/user_config.rs b/packages/wm/src/user_config.rs
index 53cea853..76abef26 100644
--- a/packages/wm/src/user_config.rs
+++ b/packages/wm/src/user_config.rs
@@ -259,7 +259,7 @@ pub struct FloatingStateConfig {
/// Whether to show floating windows as always on top.
#[serde(default = "default_bool::<false>")]
- pub show_on_top: bool,
+ pub shown_on_top: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
@@ -271,7 +271,7 @@ pub struct FullscreenStateConfig {
/// Whether to show fullscreen windows as always on top.
#[serde(default = "default_bool::<false>")]
- pub show_on_top: bool,
+ pub shown_on_top: bool,
/// Whether to remove the window's title bar when fullscreen.
#[serde(default = "default_bool::<false>")]
diff --git a/resources/sample-config.yaml b/resources/sample-config.yaml
index edf5eb28..4e30c7b8 100644
--- a/resources/sample-config.yaml
+++ b/resources/sample-config.yaml
@@ -58,7 +58,7 @@ window_behavior:
centered: true
# Whether to show floating windows as always on top.
- show_on_top: false
+ shown_on_top: false
fullscreen:
# Maximize the window if possible. If the window doesn't have a