aboutsummaryrefslogtreecommitdiff
path: root/src/niri.rs
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2023-10-01 17:42:56 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-10-01 17:50:42 +0300
commitd8a511bbac8d487c537dc325d105c1b07ff9c0cf (patch)
tree562c4f77d1ab98f704a6a03f13ca5046b8ad9dd5 /src/niri.rs
parent8d443c2e841505dd9a09d50dbb24a2a5956ecbd7 (diff)
downloadniri-d8a511bbac8d487c537dc325d105c1b07ff9c0cf.tar.gz
niri-d8a511bbac8d487c537dc325d105c1b07ff9c0cf.tar.bz2
niri-d8a511bbac8d487c537dc325d105c1b07ff9c0cf.zip
config/input: add cursor section
This should allow users to configure theme and size for the cursor, as well as automatically set `XCURSOR_THEME` and `XCURSOR_SIZE` env variables.
Diffstat (limited to 'src/niri.rs')
-rw-r--r--src/niri.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/niri.rs b/src/niri.rs
index dda9cd29..8c4579fc 100644
--- a/src/niri.rs
+++ b/src/niri.rs
@@ -262,7 +262,18 @@ impl State {
}
};
- *self.niri.config.borrow_mut() = config;
+ let mut old_config = self.niri.config.borrow_mut();
+
+ if config.cursor != old_config.cursor {
+ self.niri.default_cursor =
+ Cursor::load(&config.cursor.xcursor_theme, config.cursor.xcursor_size);
+ }
+
+ *old_config = config;
+
+ // Release the borrow.
+ drop(old_config);
+
self.niri.queue_redraw_all();
// FIXME: apply output scale and whatnot.
// FIXME: apply libinput device settings.
@@ -329,7 +340,8 @@ impl Niri {
.unwrap();
seat.add_pointer();
- let default_cursor = Cursor::load();
+ let default_cursor =
+ Cursor::load(&config_.cursor.xcursor_theme, config_.cursor.xcursor_size);
let socket_source = ListeningSocketSource::new_auto().unwrap();
let socket_name = socket_source.socket_name().to_os_string();