aboutsummaryrefslogtreecommitdiff
path: root/src/window
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-04-24 21:49:07 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2024-04-24 22:01:26 +0400
commit3e598c565e6e8ad4c34e93aec9a49e60d51d730e (patch)
tree95d3f12d04f3a416ba86915ebea01b7e0f66498e /src/window
parente261b641ed62474676c90aaa4e734cdd1ecde703 (diff)
downloadniri-3e598c565e6e8ad4c34e93aec9a49e60d51d730e.tar.gz
niri-3e598c565e6e8ad4c34e93aec9a49e60d51d730e.tar.bz2
niri-3e598c565e6e8ad4c34e93aec9a49e60d51d730e.zip
Implement border window rule
Diffstat (limited to 'src/window')
-rw-r--r--src/window/mod.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/window/mod.rs b/src/window/mod.rs
index 3c46e9e5..a793cedb 100644
--- a/src/window/mod.rs
+++ b/src/window/mod.rs
@@ -1,4 +1,4 @@
-use niri_config::{BlockOutFrom, Match, WindowRule};
+use niri_config::{BlockOutFrom, BorderRule, Match, WindowRule};
use smithay::reexports::wayland_protocols::xdg::shell::server::xdg_toplevel;
use smithay::wayland::compositor::with_states;
use smithay::wayland::shell::xdg::{
@@ -48,6 +48,9 @@ pub struct ResolvedWindowRules {
/// Extra bound on the maximum window height.
pub max_height: Option<u16>,
+ /// Window border overrides.
+ pub border: BorderRule,
+
/// Whether or not to draw the border with a solid background.
///
/// `None` means using the SSD heuristic.
@@ -87,6 +90,15 @@ impl ResolvedWindowRules {
min_height: None,
max_width: None,
max_height: None,
+ border: BorderRule {
+ off: false,
+ on: false,
+ width: None,
+ active_color: None,
+ inactive_color: None,
+ active_gradient: None,
+ inactive_gradient: None,
+ },
draw_border_with_background: None,
opacity: None,
block_out_from: None,
@@ -158,6 +170,8 @@ impl ResolvedWindowRules {
resolved.max_height = Some(x);
}
+ resolved.border.merge_with(&rule.border);
+
if let Some(x) = rule.draw_border_with_background {
resolved.draw_border_with_background = Some(x);
}