Make use of new DndGrabHandler::cancelled()

This commit is contained in:
Ivan Molodetskikh
2026-04-20 20:42:15 +03:00
parent cfe059c303
commit e9c182a13c
3 changed files with 7 additions and 8 deletions
+7 -1
View File
@@ -384,10 +384,16 @@ impl DndGrabHandler for State {
}
}
}
fn cancelled(&mut self, _seat: Seat<Self>, _location: Point<f64, Logical>) {
trace!("dnd cancelled");
self.niri.on_maybe_dnd_ended();
}
}
impl crate::niri::Niri {
pub fn on_maybe_dnd_ended(&mut self) {
fn on_maybe_dnd_ended(&mut self) {
self.layout.dnd_end();
self.dnd_icon = None;
// FIXME: more granular
-5
View File
@@ -499,11 +499,6 @@ impl State {
.unwrap_or(false)
{
pointer.unset_grab(this, serial, time);
// If this was a DnD, we won't get DndGrabHandler::dropped(), so we need to
// call the cleanup.
this.niri.on_maybe_dnd_ended();
this.niri.suppressed_keys.insert(key_code);
return FilterResult::Intercept(None);
}
-2
View File
@@ -1321,7 +1321,6 @@ impl State {
get_monotonic_time().as_millis() as u32,
);
self.niri.popup_grab = None;
self.niri.on_maybe_dnd_ended();
}
}
@@ -1977,7 +1976,6 @@ impl State {
if let Some(touch) = self.niri.seat.get_touch() {
touch.unset_grab(self);
}
self.niri.on_maybe_dnd_ended();
self.backend.with_primary_renderer(|renderer| {
self.niri