pointer: drop enum wlr_axis_relative_direction

Instead, use enum wl_pointer_axis_relative_direction from the
Wayland protocol.
This commit is contained in:
Simon Ser 2024-02-28 10:31:03 +01:00 committed by Simon Zeni
parent 812451cd8f
commit ec5263e6b7
7 changed files with 12 additions and 17 deletions

View file

@ -129,9 +129,9 @@ void handle_pointer_axis(struct libinput_event *event,
wlr_event.delta_discrete = wlr_event.delta_discrete =
libinput_event_pointer_get_axis_value_discrete(pevent, axes[i]); libinput_event_pointer_get_axis_value_discrete(pevent, axes[i]);
wlr_event.delta_discrete *= WLR_POINTER_AXIS_DISCRETE_STEP; wlr_event.delta_discrete *= WLR_POINTER_AXIS_DISCRETE_STEP;
wlr_event.relative_direction = WLR_AXIS_RELATIVE_DIRECTION_IDENTICAL; wlr_event.relative_direction = WL_POINTER_AXIS_RELATIVE_DIRECTION_IDENTICAL;
if (libinput_device_config_scroll_get_natural_scroll_enabled(libinput_event_get_device(event))) { if (libinput_device_config_scroll_get_natural_scroll_enabled(libinput_event_get_device(event))) {
wlr_event.relative_direction = WLR_AXIS_RELATIVE_DIRECTION_INVERTED; wlr_event.relative_direction = WL_POINTER_AXIS_RELATIVE_DIRECTION_INVERTED;
} }
wl_signal_emit_mutable(&pointer->events.axis, &wlr_event); wl_signal_emit_mutable(&pointer->events.axis, &wlr_event);
} }

View file

@ -109,7 +109,7 @@ struct wlr_wl_pointer {
enum wl_pointer_axis_source axis_source; enum wl_pointer_axis_source axis_source;
int32_t axis_discrete; int32_t axis_discrete;
uint32_t fingers; // trackpad gesture uint32_t fingers; // trackpad gesture
enum wlr_axis_relative_direction axis_relative_direction; enum wl_pointer_axis_relative_direction axis_relative_direction;
struct wl_listener output_destroy; struct wl_listener output_destroy;

View file

@ -71,11 +71,6 @@ enum wlr_axis_orientation {
WLR_AXIS_ORIENTATION_HORIZONTAL, WLR_AXIS_ORIENTATION_HORIZONTAL,
}; };
enum wlr_axis_relative_direction {
WLR_AXIS_RELATIVE_DIRECTION_IDENTICAL,
WLR_AXIS_RELATIVE_DIRECTION_INVERTED,
};
#define WLR_POINTER_AXIS_DISCRETE_STEP 120 #define WLR_POINTER_AXIS_DISCRETE_STEP 120
struct wlr_pointer_axis_event { struct wlr_pointer_axis_event {
@ -83,7 +78,7 @@ struct wlr_pointer_axis_event {
uint32_t time_msec; uint32_t time_msec;
enum wl_pointer_axis_source source; enum wl_pointer_axis_source source;
enum wlr_axis_orientation orientation; enum wlr_axis_orientation orientation;
enum wlr_axis_relative_direction relative_direction; enum wl_pointer_axis_relative_direction relative_direction;
double delta; double delta;
int32_t delta_discrete; int32_t delta_discrete;
}; };

View file

@ -102,7 +102,7 @@ struct wlr_pointer_grab_interface {
void (*axis)(struct wlr_seat_pointer_grab *grab, uint32_t time_msec, void (*axis)(struct wlr_seat_pointer_grab *grab, uint32_t time_msec,
enum wlr_axis_orientation orientation, double value, enum wlr_axis_orientation orientation, double value,
int32_t value_discrete, enum wl_pointer_axis_source source, int32_t value_discrete, enum wl_pointer_axis_source source,
enum wlr_axis_relative_direction relative_direction); enum wl_pointer_axis_relative_direction relative_direction);
void (*frame)(struct wlr_seat_pointer_grab *grab); void (*frame)(struct wlr_seat_pointer_grab *grab);
void (*cancel)(struct wlr_seat_pointer_grab *grab); void (*cancel)(struct wlr_seat_pointer_grab *grab);
}; };
@ -409,7 +409,7 @@ uint32_t wlr_seat_pointer_send_button(struct wlr_seat *wlr_seat,
void wlr_seat_pointer_send_axis(struct wlr_seat *wlr_seat, uint32_t time_msec, void wlr_seat_pointer_send_axis(struct wlr_seat *wlr_seat, uint32_t time_msec,
enum wlr_axis_orientation orientation, double value, enum wlr_axis_orientation orientation, double value,
int32_t value_discrete, enum wl_pointer_axis_source source, int32_t value_discrete, enum wl_pointer_axis_source source,
enum wlr_axis_relative_direction relative_direction); enum wl_pointer_axis_relative_direction relative_direction);
/** /**
* Send a frame event to the surface with pointer focus. This function does not * Send a frame event to the surface with pointer focus. This function does not
@ -461,7 +461,7 @@ uint32_t wlr_seat_pointer_notify_button(struct wlr_seat *wlr_seat,
void wlr_seat_pointer_notify_axis(struct wlr_seat *wlr_seat, uint32_t time_msec, void wlr_seat_pointer_notify_axis(struct wlr_seat *wlr_seat, uint32_t time_msec,
enum wlr_axis_orientation orientation, double value, enum wlr_axis_orientation orientation, double value,
int32_t value_discrete, enum wl_pointer_axis_source source, int32_t value_discrete, enum wl_pointer_axis_source source,
enum wlr_axis_relative_direction relative_direction); enum wl_pointer_axis_relative_direction relative_direction);
/** /**
* Notify the seat of a frame event. Frame events are sent to end a group of * Notify the seat of a frame event. Frame events are sent to end a group of

View file

@ -236,7 +236,7 @@ static uint32_t drag_handle_pointer_button(struct wlr_seat_pointer_grab *grab,
static void drag_handle_pointer_axis(struct wlr_seat_pointer_grab *grab, static void drag_handle_pointer_axis(struct wlr_seat_pointer_grab *grab,
uint32_t time, enum wlr_axis_orientation orientation, double value, uint32_t time, enum wlr_axis_orientation orientation, double value,
int32_t value_discrete, enum wl_pointer_axis_source source, int32_t value_discrete, enum wl_pointer_axis_source source,
enum wlr_axis_relative_direction relative_direction) { enum wl_pointer_axis_relative_direction relative_direction) {
// This space is intentionally left blank // This space is intentionally left blank
} }

View file

@ -30,7 +30,7 @@ static uint32_t default_pointer_button(struct wlr_seat_pointer_grab *grab,
static void default_pointer_axis(struct wlr_seat_pointer_grab *grab, static void default_pointer_axis(struct wlr_seat_pointer_grab *grab,
uint32_t time, enum wlr_axis_orientation orientation, double value, uint32_t time, enum wlr_axis_orientation orientation, double value,
int32_t value_discrete, enum wl_pointer_axis_source source, int32_t value_discrete, enum wl_pointer_axis_source source,
enum wlr_axis_relative_direction relative_direction) { enum wl_pointer_axis_relative_direction relative_direction) {
wlr_seat_pointer_send_axis(grab->seat, time, orientation, value, wlr_seat_pointer_send_axis(grab->seat, time, orientation, value,
value_discrete, source, relative_direction); value_discrete, source, relative_direction);
} }
@ -322,7 +322,7 @@ static void update_value120_accumulators(struct wlr_seat_client *client,
void wlr_seat_pointer_send_axis(struct wlr_seat *wlr_seat, uint32_t time, void wlr_seat_pointer_send_axis(struct wlr_seat *wlr_seat, uint32_t time,
enum wlr_axis_orientation orientation, double value, enum wlr_axis_orientation orientation, double value,
int32_t value_discrete, enum wl_pointer_axis_source source, int32_t value_discrete, enum wl_pointer_axis_source source,
enum wlr_axis_relative_direction relative_direction) { enum wl_pointer_axis_relative_direction relative_direction) {
struct wlr_seat_client *client = wlr_seat->pointer_state.focused_client; struct wlr_seat_client *client = wlr_seat->pointer_state.focused_client;
if (client == NULL) { if (client == NULL) {
return; return;
@ -485,7 +485,7 @@ uint32_t wlr_seat_pointer_notify_button(struct wlr_seat *wlr_seat,
void wlr_seat_pointer_notify_axis(struct wlr_seat *wlr_seat, uint32_t time, void wlr_seat_pointer_notify_axis(struct wlr_seat *wlr_seat, uint32_t time,
enum wlr_axis_orientation orientation, double value, enum wlr_axis_orientation orientation, double value,
int32_t value_discrete, enum wl_pointer_axis_source source, int32_t value_discrete, enum wl_pointer_axis_source source,
enum wlr_axis_relative_direction relative_direction) { enum wl_pointer_axis_relative_direction relative_direction) {
clock_gettime(CLOCK_MONOTONIC, &wlr_seat->last_event); clock_gettime(CLOCK_MONOTONIC, &wlr_seat->last_event);
struct wlr_seat_pointer_grab *grab = wlr_seat->pointer_state.grab; struct wlr_seat_pointer_grab *grab = wlr_seat->pointer_state.grab;
grab->interface->axis(grab, time, orientation, value, value_discrete, grab->interface->axis(grab, time, orientation, value, value_discrete,

View file

@ -83,7 +83,7 @@ static uint32_t xdg_pointer_grab_button(struct wlr_seat_pointer_grab *grab,
static void xdg_pointer_grab_axis(struct wlr_seat_pointer_grab *grab, static void xdg_pointer_grab_axis(struct wlr_seat_pointer_grab *grab,
uint32_t time, enum wlr_axis_orientation orientation, double value, uint32_t time, enum wlr_axis_orientation orientation, double value,
int32_t value_discrete, enum wl_pointer_axis_source source, int32_t value_discrete, enum wl_pointer_axis_source source,
enum wlr_axis_relative_direction relative_direction) { enum wl_pointer_axis_relative_direction relative_direction) {
wlr_seat_pointer_send_axis(grab->seat, time, orientation, value, wlr_seat_pointer_send_axis(grab->seat, time, orientation, value,
value_discrete, source, relative_direction); value_discrete, source, relative_direction);
} }