Skip to content

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

feat: allow setting bar as always on top (#341)

jrfsbe27391ddc98
diff --git a/GlazeWM.Bar/BarViewModel.cs b/GlazeWM.Bar/BarViewModel.cs
index 36aa1280..46827ef9 100644
--- a/GlazeWM.Bar/BarViewModel.cs
+++ b/GlazeWM.Bar/BarViewModel.cs
@@ -19,6 +19,7 @@ namespace GlazeWM.Bar
public BarConfig BarConfig { get; }
public BarPosition Position => BarConfig.Position;
+ public bool AlwaysOnTop => BarConfig.AlwaysOnTop;
public string Background => XamlHelper.FormatColor(BarConfig.Background);
public string Foreground => XamlHelper.FormatColor(BarConfig.Foreground);
public string FontFamily => BarConfig.FontFamily;
diff --git a/GlazeWM.Bar/MainWindow.xaml b/GlazeWM.Bar/MainWindow.xaml
index 0f946644..c41f347d 100644
--- a/GlazeWM.Bar/MainWindow.xaml
+++ b/GlazeWM.Bar/MainWindow.xaml
@@ -19,7 +19,7 @@
FontSize="{Binding FontSize}"
Opacity="{Binding Opacity}"
AllowsTransparency="True"
- Topmost="False">
+ Topmost="{Binding AlwaysOnTop}">
<Border
CornerRadius="{Binding BorderRadius}"
BorderThickness="{Binding BorderWidth}"
diff --git a/GlazeWM.Domain/UserConfigs/BarConfig.cs b/GlazeWM.Domain/UserConfigs/BarConfig.cs
index 5833c97f..e97407ef 100644
--- a/GlazeWM.Domain/UserConfigs/BarConfig.cs
+++ b/GlazeWM.Domain/UserConfigs/BarConfig.cs
@@ -6,6 +6,8 @@ namespace GlazeWM.Domain.UserConfigs
{
public bool Enabled { get; set; } = true;
+ public bool AlwaysOnTop { get; set; } = false;
+
public string OffsetX { get; set; } = "0px";
public string OffsetY { get; set; } = "0px";
diff --git a/README.md b/README.md
index 4da40942..7576ac2d 100644
--- a/README.md
+++ b/README.md
@@ -161,6 +161,9 @@ bar:
# The position of the bar on the screen. Can be either "top" or "bottom".
position: "top"
+ # Whether to show the bar above other windows
+ always_on_top: false
+
# Opacity value between 0.0 and 1.0.
opacity: 1.0