srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/crates/config/src/engine/window.rs
diff options
context:
space:
mode:
authorsrdusr <[email protected]>2025-01-17 23:01:00 +0200
committersrdusr <[email protected]>2025-01-17 23:01:00 +0200
commit6c1dfe191843ad56aaa0381e5645ad9e74c38b8b (patch)
tree427d72a55eba93b2f0da299342c12bd3c61df1d6 /crates/config/src/engine/window.rs
parent3d73ed0f057a555ded67ad58dbe02b36cd4d2d1f (diff)
downloadsrdwm-6c1dfe191843ad56aaa0381e5645ad9e74c38b8b.tar.gz
srdwm-6c1dfe191843ad56aaa0381e5645ad9e74c38b8b.zip
Accumulate config engine, build metadata, and doc updates
Remaining files from the backlog: Lua config engine additions (general/register/support/window), workspace Cargo.toml/ Cargo.lock churn from the new dependencies added elsewhere in this sweep, srdwm/main.rs wiring, and docs (DEFAULTS.md plus a new SESSION_HANDOFF.md written mid-session for continuity across a restart - see that file's own header for what it is and isn't).
Diffstat (limited to 'crates/config/src/engine/window.rs')
-rw-r--r--crates/config/src/engine/window.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/config/src/engine/window.rs b/crates/config/src/engine/window.rs
index a7e6bf3..61e7b89 100644
--- a/crates/config/src/engine/window.rs
+++ b/crates/config/src/engine/window.rs
@@ -139,6 +139,20 @@ impl Engine {
})?)
}
+ pub(super) fn fn_window_set_corner_radius(&self) -> Result<mlua::Function<'_>> {
+ let state = self.state.clone();
+ Ok(self.lua.create_function(move |_, radius: u32| {
+ let wm = state.borrow().wm.clone();
+ let mut wm = wm.borrow_mut();
+ if let Some(id) = wm.focused_id() {
+ if let Some(w) = wm.window_mut(id) {
+ w.corner_radius = radius;
+ }
+ }
+ Ok(())
+ })?)
+ }
+
pub(super) fn fn_window_set_opacity(&self) -> Result<mlua::Function<'_>> {
let state = self.state.clone();
Ok(self.lua.create_function(move |_, opacity: f32| {