Add unset method to input grab traits

Fixes https://github.com/pop-os/cosmic-comp/issues/403.
This commit is contained in:
Ian Douglas Scott 2024-04-12 09:48:29 -07:00 committed by Victoria Brekenfeld
parent d16a9e387d
commit 1216cd0b67
8 changed files with 36 additions and 6 deletions

View file

@ -634,6 +634,8 @@ impl PointerGrab<State> for MenuGrab {
fn start_data(&self) -> &PointerGrabStartData<State> {
&self.start_data
}
fn unset(&mut self, _data: &mut State) {}
}
impl MenuGrab {

View file

@ -313,6 +313,13 @@ impl PointerGrab<State> for ResizeGrab {
ResizeGrab::Tiling(grab) => PointerGrab::start_data(grab),
}
}
fn unset(&mut self, data: &mut State) {
match self {
ResizeGrab::Floating(grab) => PointerGrab::unset(grab, data),
ResizeGrab::Tiling(grab) => PointerGrab::unset(grab, data),
}
}
}
impl TouchGrab<State> for ResizeGrab {
@ -377,4 +384,11 @@ impl TouchGrab<State> for ResizeGrab {
ResizeGrab::Tiling(grab) => TouchGrab::start_data(grab),
}
}
fn unset(&mut self, data: &mut State) {
match self {
ResizeGrab::Floating(grab) => TouchGrab::unset(grab, data),
ResizeGrab::Tiling(grab) => TouchGrab::unset(grab, data),
}
}
}

View file

@ -575,6 +575,8 @@ impl PointerGrab<State> for MoveGrab {
_ => unreachable!(),
}
}
fn unset(&mut self, _data: &mut State) {}
}
impl TouchGrab<State> for MoveGrab {
@ -632,6 +634,8 @@ impl TouchGrab<State> for MoveGrab {
_ => unreachable!(),
}
}
fn unset(&mut self, _data: &mut State) {}
}
impl MoveGrab {