Skip to content

Commit

Permalink
wayland: remove duplicate leave events
Browse files Browse the repository at this point in the history
  • Loading branch information
mahkoh committed Jul 2, 2024
1 parent 84d7632 commit e4aa519
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
4 changes: 0 additions & 4 deletions src/ifs/wl_seat/event_handling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,6 @@ impl NodeSeatState {
self.kb_foci.iter().for_each(|(_, s)| f(s));
}

pub fn for_each_pointer_focus<F: FnMut(Rc<WlSeatGlobal>)>(&self, mut f: F) {
self.pointer_foci.iter().for_each(|(_, s)| f(s));
}

pub fn destroy_node(&self, node: &dyn Node) {
self.destroy_node2(node, true);
}
Expand Down
11 changes: 0 additions & 11 deletions src/ifs/wl_surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1261,13 +1261,6 @@ impl WlSurface {
}
}

fn send_seat_release_events(&self) {
self.seat_state
.for_each_pointer_focus(|s| s.leave_surface(self));
self.seat_state
.for_each_kb_focus(|s| s.unfocus_surface(self));
}

pub fn set_visible(&self, visible: bool) {
if self.visible.replace(visible) == visible {
return;
Expand All @@ -1287,9 +1280,6 @@ impl WlSurface {
}
}
}
if !visible {
self.send_seat_release_events();
}
self.seat_state.set_visible(self, visible);
}

Expand Down Expand Up @@ -1318,7 +1308,6 @@ impl WlSurface {
data.focus_node.remove(&seat);
}
}
self.send_seat_release_events();
self.seat_state.destroy_node(self);
if self.visible.get() {
self.client.state.damage();
Expand Down

0 comments on commit e4aa519

Please sign in to comment.