refactor: make handle_pending_enter fn function
This commit is contained in:
parent
e8079bc072
commit
56256a1340
1 changed files with 36 additions and 30 deletions
|
|
@ -460,7 +460,12 @@ impl Event for client::wl_pointer::Event {
|
|||
// Niri). Other compositors do not run into this problem because they appear to not send
|
||||
// wl_pointer.enter until the user actually moves the mouse in the popup.
|
||||
|
||||
let handle_pending_enter = |target: Entity, state: &mut ServerState<C>, event_str: &str| loop {
|
||||
fn handle_pending_enter<C: XConnection>(
|
||||
target: Entity,
|
||||
state: &mut ServerState<C>,
|
||||
event_str: &str,
|
||||
) -> bool {
|
||||
loop {
|
||||
let Ok(pe) = state.world.get::<&PendingEnter>(target) else {
|
||||
return true;
|
||||
};
|
||||
|
|
@ -487,12 +492,13 @@ impl Event for client::wl_pointer::Event {
|
|||
};
|
||||
|
||||
drop(pe);
|
||||
Self::handle(enter_event, target, state);
|
||||
Event::handle(enter_event, target, state);
|
||||
} else {
|
||||
warn!("could not move pointer to surface: stale surface");
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
match self {
|
||||
Self::Enter {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue