aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--resources/default-config.kdl1
-rw-r--r--src/handlers/xdg_shell.rs12
2 files changed, 13 insertions, 0 deletions
diff --git a/resources/default-config.kdl b/resources/default-config.kdl
index ec7ccc84..15b46a52 100644
--- a/resources/default-config.kdl
+++ b/resources/default-config.kdl
@@ -91,6 +91,7 @@ cursor {
// Uncomment this line to ask the clients to omit their client-side decorations if possible.
// If the client will specifically ask for CSD, the request will be honored.
+// Additionally, clients will be informed that they are tiled, removing some rounded corners.
// prefer-no-csd
// You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between.
diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs
index c5af09a9..d0532a3b 100644
--- a/src/handlers/xdg_shell.rs
+++ b/src/handlers/xdg_shell.rs
@@ -31,6 +31,18 @@ impl XdgShellHandler for State {
ws.configure_new_window(&window);
}
+ // If the user prefers no CSD, it's a reasonable assumption that they would prefer to get
+ // rid of the various client-side rounded corners also by using the tiled state.
+ let config = self.niri.config.borrow();
+ if config.prefer_no_csd {
+ window.toplevel().with_pending_state(|state| {
+ state.states.set(xdg_toplevel::State::TiledLeft);
+ state.states.set(xdg_toplevel::State::TiledRight);
+ state.states.set(xdg_toplevel::State::TiledTop);
+ state.states.set(xdg_toplevel::State::TiledBottom);
+ });
+ }
+
// At the moment of creation, xdg toplevels must have no buffer.
let existing = self.niri.unmapped_windows.insert(wl_surface, window);
assert!(existing.is_none());