make wlroots libinput backend optional

This commit is contained in:
Consolatis 2026-03-29 20:31:33 +02:00
parent dfbea3e156
commit 8c6faa010f
4 changed files with 34 additions and 7 deletions

View file

@ -3,7 +3,7 @@
#include "input/cursor.h"
#include <assert.h>
#include <time.h>
#include <wlr/backend/libinput.h>
#include <wlr/config.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_cursor_shape_v1.h>
#include <wlr/types/wlr_data_device.h>
@ -38,6 +38,10 @@
#include "view.h"
#include "xwayland.h"
#if WLR_HAS_LIBINPUT_BACKEND
#include <wlr/backend/libinput.h>
#endif
#define LAB_CURSOR_SHAPE_V1_VERSION 1
struct constraint {
@ -898,6 +902,7 @@ preprocess_cursor_motion(struct seat *seat, struct wlr_pointer *pointer,
static double get_natural_scroll_factor(struct wlr_input_device *wlr_input_device)
{
#if WLR_HAS_LIBINPUT_BACKEND
if (wlr_input_device_is_libinput(wlr_input_device)) {
struct libinput_device *libinput_device =
wlr_libinput_get_device_handle(wlr_input_device);
@ -905,7 +910,7 @@ static double get_natural_scroll_factor(struct wlr_input_device *wlr_input_devic
return -1.0;
}
}
#endif
return 1.0;
}