diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-10-16 14:58:03 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-10-16 15:21:43 +0400 |
| commit | 58f6b3032519ce22635aba0d2d55f00c57c6e0f5 (patch) | |
| tree | 163cb82e58049c89e075edc3a054e2e97525c783 /src | |
| parent | 052ecdbe2ae5d13e32a6a11ed5d6f5cdf5531674 (diff) | |
| download | niri-58f6b3032519ce22635aba0d2d55f00c57c6e0f5.tar.gz niri-58f6b3032519ce22635aba0d2d55f00c57c6e0f5.tar.bz2 niri-58f6b3032519ce22635aba0d2d55f00c57c6e0f5.zip | |
Send tiled state when prefer-no-csd is set
Diffstat (limited to 'src')
| -rw-r--r-- | src/handlers/xdg_shell.rs | 12 |
1 files changed, 12 insertions, 0 deletions
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()); |
