refactor: remove unnecessary mutability on selection

This commit is contained in:
drendog 2026-01-18 22:35:51 +01:00
parent 0f9fb49558
commit c9ab178633
Signed by: dwenya
GPG key ID: 8DD77074645332D0
2 changed files with 4 additions and 4 deletions

View file

@ -26,7 +26,7 @@ impl<'a> LockSelection<'a> {
/// Handler receives a `CallbackContext` with surface identity and shell control. /// Handler receives a `CallbackContext` with surface identity and shell control.
/// Callbacks are stored and applied when the lock is activated, and automatically /// Callbacks are stored and applied when the lock is activated, and automatically
/// applied to new surfaces when outputs are hotplugged during an active lock. /// applied to new surfaces when outputs are hotplugged during an active lock.
pub fn on_callback<F, R>(&mut self, callback_name: &str, handler: F) -> &mut Self pub fn on_callback<F, R>(&self, callback_name: &str, handler: F) -> &Self
where where
F: Fn(crate::CallbackContext) -> R + Clone + 'static, F: Fn(crate::CallbackContext) -> R + Clone + 'static,
R: crate::IntoValue, R: crate::IntoValue,
@ -37,7 +37,7 @@ impl<'a> LockSelection<'a> {
} }
/// Registers a callback handler that receives arguments for all matching lock surfaces /// Registers a callback handler that receives arguments for all matching lock surfaces
pub fn on_callback_with_args<F, R>(&mut self, callback_name: &str, handler: F) -> &mut Self pub fn on_callback_with_args<F, R>(&self, callback_name: &str, handler: F) -> &Self
where where
F: Fn(&[Value], crate::CallbackContext) -> R + Clone + 'static, F: Fn(&[Value], crate::CallbackContext) -> R + Clone + 'static,
R: crate::IntoValue, R: crate::IntoValue,

View file

@ -94,7 +94,7 @@ impl<'a> Selection<'a> {
/// Registers a callback handler for all matching surfaces /// Registers a callback handler for all matching surfaces
/// ///
/// Handler receives a `CallbackContext` with surface identity and shell control. /// Handler receives a `CallbackContext` with surface identity and shell control.
pub fn on_callback<F, R>(&mut self, callback_name: &str, handler: F) -> &mut Self pub fn on_callback<F, R>(&self, callback_name: &str, handler: F) -> &Self
where where
F: Fn(crate::CallbackContext) -> R + Clone + 'static, F: Fn(crate::CallbackContext) -> R + Clone + 'static,
R: crate::IntoValue, R: crate::IntoValue,
@ -105,7 +105,7 @@ impl<'a> Selection<'a> {
} }
/// Registers a callback handler that receives arguments for all matching surfaces /// Registers a callback handler that receives arguments for all matching surfaces
pub fn on_callback_with_args<F, R>(&mut self, callback_name: &str, handler: F) -> &mut Self pub fn on_callback_with_args<F, R>(&self, callback_name: &str, handler: F) -> &Self
where where
F: Fn(&[Value], crate::CallbackContext) -> R + Clone + 'static, F: Fn(&[Value], crate::CallbackContext) -> R + Clone + 'static,
R: crate::IntoValue, R: crate::IntoValue,