Add extra wl_pointer callbacks for v8 and v9
This commit is contained in:
parent
4e9eb97960
commit
c98b67fcd3
1 changed files with 15 additions and 2 deletions
17
wayland.c
17
wayland.c
|
|
@ -326,6 +326,16 @@ void pointer_axis_discrete_callback(void *data, struct wl_pointer *pointer, uint
|
|||
//fprintf(stdout, "Pointer axis discrete step: %d\n", discrete);
|
||||
}
|
||||
|
||||
void pointer_axis_value120_callback(void *data, struct wl_pointer *pointer, uint axis, int value120)
|
||||
{
|
||||
fprintf(stdout, "Pointer axis value120: %d\n", value120);
|
||||
}
|
||||
|
||||
void pointer_axis_relative_direction_callback(void *data, struct wl_pointer *pointer, uint axis, uint direction)
|
||||
{
|
||||
fprintf(stdout, "Pointer axis direction: %d\n", direction);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
fprintf(stdout, "Starting platform layer...\n");
|
||||
|
|
@ -419,7 +429,8 @@ int main()
|
|||
if (wl_keyboard_add_listener(wl_keyboard, &wl_keyboard_listener, NULL))
|
||||
fprintf(stderr, "Could not set XKB keyboard listener\n");
|
||||
|
||||
// TODO: Apparently we are not setting opcode 10's callback?
|
||||
/* NOTE: Apparently wl_pointer added 'axis_value120' with v8 and 'axis_relative_direction' events with v9.
|
||||
Failing to provide callbacks for them crashes the client in runtime */
|
||||
const struct wl_pointer_listener wl_pointer_listener = {
|
||||
.enter = pointer_enter_callback,
|
||||
.leave = pointer_leave_callback,
|
||||
|
|
@ -429,7 +440,9 @@ int main()
|
|||
.frame = pointer_frame_callback,
|
||||
.axis_source = pointer_axis_source_callback,
|
||||
.axis_stop = pointer_axis_stop_callback,
|
||||
.axis_discrete = pointer_axis_discrete_callback
|
||||
.axis_discrete = pointer_axis_discrete_callback,
|
||||
.axis_value120 = pointer_axis_value120_callback,
|
||||
.axis_relative_direction = pointer_axis_relative_direction_callback,
|
||||
};
|
||||
|
||||
if (wl_pointer_add_listener(wl_pointer, &wl_pointer_listener, NULL))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue