Skip to content

Commit

Permalink
quickfix for grace detecting pointer motion
Browse files Browse the repository at this point in the history
even though there is none.

See also: jirutka#68

Signed-off-by: Pascal Jäger <[email protected]>
  • Loading branch information
Schievel1 committed Oct 8, 2024
1 parent 750d287 commit 4380f8b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion seat.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,17 @@ static void wl_pointer_leave(void *data, struct wl_pointer *wl_pointer,

static void wl_pointer_motion(void *data, struct wl_pointer *wl_pointer,
uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y) {
swaylock_handle_mouse((struct swaylock_state *)data);
static int last_x = 0;
static int last_y = 0;
int x = wl_fixed_to_int(surface_x);
int y = wl_fixed_to_int(surface_y);

if (last_x > 0 && (x - last_x > 1 || y - last_y > 1)) {
swaylock_handle_mouse((struct swaylock_state *)data);
}

last_x = x;
last_y = y;
}

static void wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
Expand Down

0 comments on commit 4380f8b

Please sign in to comment.