@@ -199,11 +199,9 @@ void wlr_seat_pointer_enter(struct wlr_seat *wlr_seat,
199
199
wlr_seat -> pointer_state .focused_client = client ;
200
200
wlr_seat -> pointer_state .focused_surface = surface ;
201
201
if (surface != NULL ) {
202
- wlr_seat -> pointer_state .sx = sx ;
203
- wlr_seat -> pointer_state .sy = sy ;
202
+ wlr_seat_pointer_warp (wlr_seat , sx , sy );
204
203
} else {
205
- wlr_seat -> pointer_state .sx = NAN ;
206
- wlr_seat -> pointer_state .sy = NAN ;
204
+ wlr_seat_pointer_warp (wlr_seat , NAN , NAN );
207
205
}
208
206
209
207
struct wlr_seat_pointer_focus_change_event event = {
@@ -220,6 +218,11 @@ void wlr_seat_pointer_clear_focus(struct wlr_seat *wlr_seat) {
220
218
wlr_seat_pointer_enter (wlr_seat , NULL , 0 , 0 );
221
219
}
222
220
221
+ void wlr_seat_pointer_warp (struct wlr_seat * wlr_seat , double sx , double sy ) {
222
+ wlr_seat -> pointer_state .sx = sx ;
223
+ wlr_seat -> pointer_state .sy = sy ;
224
+ }
225
+
223
226
void wlr_seat_pointer_send_motion (struct wlr_seat * wlr_seat , uint32_t time ,
224
227
double sx , double sy ) {
225
228
struct wlr_seat_client * client = wlr_seat -> pointer_state .focused_client ;
@@ -241,8 +244,7 @@ void wlr_seat_pointer_send_motion(struct wlr_seat *wlr_seat, uint32_t time,
241
244
wl_fixed_from_double (sy ));
242
245
}
243
246
244
- wlr_seat -> pointer_state .sx = sx ;
245
- wlr_seat -> pointer_state .sy = sy ;
247
+ wlr_seat_pointer_warp (wlr_seat , sx , sy );
246
248
}
247
249
248
250
uint32_t wlr_seat_pointer_send_button (struct wlr_seat * wlr_seat , uint32_t time ,
0 commit comments