mirror of
https://codeberg.org/waydeer/layer-shika.git
synced 2026-01-22 07:05:56 +00:00
refactor: remove unnecessary mutability on selection
This commit is contained in:
parent
0f9fb49558
commit
c9ab178633
2 changed files with 4 additions and 4 deletions
|
|
@ -26,7 +26,7 @@ impl<'a> LockSelection<'a> {
|
|||
/// Handler receives a `CallbackContext` with surface identity and shell control.
|
||||
/// Callbacks are stored and applied when the lock is activated, and automatically
|
||||
/// 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
|
||||
F: Fn(crate::CallbackContext) -> R + Clone + 'static,
|
||||
R: crate::IntoValue,
|
||||
|
|
@ -37,7 +37,7 @@ impl<'a> LockSelection<'a> {
|
|||
}
|
||||
|
||||
/// 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
|
||||
F: Fn(&[Value], crate::CallbackContext) -> R + Clone + 'static,
|
||||
R: crate::IntoValue,
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ impl<'a> Selection<'a> {
|
|||
/// Registers a callback handler for all matching surfaces
|
||||
///
|
||||
/// 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
|
||||
F: Fn(crate::CallbackContext) -> R + Clone + 'static,
|
||||
R: crate::IntoValue,
|
||||
|
|
@ -105,7 +105,7 @@ impl<'a> Selection<'a> {
|
|||
}
|
||||
|
||||
/// 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
|
||||
F: Fn(&[Value], crate::CallbackContext) -> R + Clone + 'static,
|
||||
R: crate::IntoValue,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue