1
0
Fork 0
forked from wry/wry

wl-seat: remove cursor_moved defer parameter

It's always false.
This commit is contained in:
Julian Orth 2026-03-11 09:49:41 +01:00
parent 150ead2127
commit 284d904eb2
3 changed files with 9 additions and 13 deletions

View file

@ -227,7 +227,7 @@ impl EiDeviceRequestHandler for EiDevice {
if let Some((x, y)) = self.absolute_motion.take() { if let Some((x, y)) = self.absolute_motion.take() {
let x = Fixed::from_f32(x); let x = Fixed::from_f32(x);
let y = Fixed::from_f32(y); let y = Fixed::from_f32(y);
seat.motion_event_abs(time, x, y, false); seat.motion_event_abs(time, x, y);
} }
{ {
let mut need_frame = false; let mut need_frame = false;

View file

@ -1974,6 +1974,6 @@ pub async fn handle_position_hint_requests(state: Rc<State>) {
req.new_pos.0 + (current_pos.0 - req.old_pos.0), req.new_pos.0 + (current_pos.0 - req.old_pos.0),
req.new_pos.1 + (current_pos.1 - req.old_pos.1), req.new_pos.1 + (current_pos.1 - req.old_pos.1),
); );
req.seat.motion_event_abs(state.now_usec(), x, y, false); req.seat.motion_event_abs(state.now_usec(), x, y);
} }
} }

View file

@ -595,10 +595,10 @@ impl WlSeatGlobal {
let pos = output.global.pos.get(); let pos = output.global.pos.get();
x += Fixed::from_int(pos.x1()); x += Fixed::from_int(pos.x1());
y += Fixed::from_int(pos.y1()); y += Fixed::from_int(pos.y1());
self.motion_event_abs(time_usec, x, y, false); self.motion_event_abs(time_usec, x, y);
} }
pub fn motion_event_abs(self: &Rc<Self>, time_usec: u64, x: Fixed, y: Fixed, defer: bool) { pub fn motion_event_abs(self: &Rc<Self>, time_usec: u64, x: Fixed, y: Fixed) {
self.for_each_ei_seat(|ei_seat| { self.for_each_ei_seat(|ei_seat| {
ei_seat.handle_motion_abs(time_usec, x, y); ei_seat.handle_motion_abs(time_usec, x, y);
}); });
@ -611,7 +611,7 @@ impl WlSeatGlobal {
self.state.for_each_seat_tester(|t| { self.state.for_each_seat_tester(|t| {
t.send_pointer_abs(self.id, time_usec, x, y); t.send_pointer_abs(self.id, time_usec, x, y);
}); });
self.cursor_moved(time_usec, defer); self.cursor_moved(time_usec);
} }
pub fn motion_event( pub fn motion_event(
@ -666,7 +666,7 @@ impl WlSeatGlobal {
); );
}); });
self.set_pointer_cursor_position(x, y); self.set_pointer_cursor_position(x, y);
self.cursor_moved(time_usec, false); self.cursor_moved(time_usec);
} }
fn motion_absolute_event( fn motion_absolute_event(
@ -678,7 +678,7 @@ impl WlSeatGlobal {
) { ) {
let x = Fixed::from_f32(rect.x1() as f32 + x_normed * rect.width() as f32); let x = Fixed::from_f32(rect.x1() as f32 + x_normed * rect.width() as f32);
let y = Fixed::from_f32(rect.y1() as f32 + y_normed * rect.height() as f32); let y = Fixed::from_f32(rect.y1() as f32 + y_normed * rect.height() as f32);
self.motion_event_abs(time_usec, x, y, false); self.motion_event_abs(time_usec, x, y);
} }
pub fn button_event(self: &Rc<Self>, time_usec: u64, button: u32, state: ButtonState) { pub fn button_event(self: &Rc<Self>, time_usec: u64, button: u32, state: ButtonState) {
@ -1283,14 +1283,10 @@ impl WlSeatGlobal {
}); });
} }
fn cursor_moved(self: &Rc<Self>, time_usec: u64, defer: bool) { fn cursor_moved(self: &Rc<Self>, time_usec: u64) {
self.pos_time_usec.set(time_usec); self.pos_time_usec.set(time_usec);
self.changes.or_assign(CHANGE_CURSOR_MOVED); self.changes.or_assign(CHANGE_CURSOR_MOVED);
if defer { self.apply_changes();
self.trigger_tree_changed(false);
} else {
self.apply_changes();
}
} }
pub fn emulate_cursor_moved(&self) { pub fn emulate_cursor_moved(&self) {