From f43ec9b27ebe37b799709985f5587e29ec8ef88b Mon Sep 17 00:00:00 2001 From: Jack Jamison Date: Sat, 11 Oct 2025 02:30:18 -0400 Subject: refactor to .h files --- pointer.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'pointer.c') diff --git a/pointer.c b/pointer.c index 8acab04..9d36df8 100644 --- a/pointer.c +++ b/pointer.c @@ -1,7 +1,13 @@ -#include "./state.h" -#include "cursor-shape-v1.h" -#define CLAMP(x, min, max) (x > max ? max : (x < min ? min : x)) +#include "state.h" +struct wl_pointer_listener pointer_listener; + +void setup_pointer(client_state* state) { + state->pointer = wl_seat_get_pointer(state->seat); + state->cursor_shape_device = wp_cursor_shape_manager_v1_get_pointer( + state->cursor_shape_manager, state->pointer); + wl_pointer_add_listener(state->pointer, &pointer_listener, state); +} void enter(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t fixed_surface_x, wl_fixed_t fixed_surface_y) { -- cgit v1.2.3