package/wlroots: fix build with libinput 1.31

Buildroot commit 0433c8d02a bumped
libinput to version 1.31.0 which causes a build error with wlroot:

../backend/libinput/switch.c: In function ‘handle_switch_toggle’:
../backend/libinput/switch.c:32:9: error: enumeration value
 ‘LIBINPUT_SWITCH_KEYPAD_SLIDE’ not handled in switch [-Werror=switch]
   32 |         switch (libinput_event_switch_get_switch(sevent)) {

The build error was not yet detected by the autobuilders but can be
reproduced using this defconfig:

BR2_x86_64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_PER_PACKAGE_DIRECTORIES=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
BR2_PACKAGE_MESA3D_OPENGL_GLX=y
BR2_PACKAGE_MESA3D_OPENGL_EGL=y
BR2_PACKAGE_MESA3D_OPENGL_ES=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_WLROOTS=y

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Bernd Kuhls
2026-02-27 19:32:14 +01:00
committed by Peter Korsgaard
parent 13daf36ee2
commit 3fcfe01d70

View File

@@ -0,0 +1,51 @@
From c1452d88114710f5772662b1d8efb9c71edaa34c Mon Sep 17 00:00:00 2001
From: Aleksei Bavshin <alebastr89@gmail.com>
Date: Sat, 7 Feb 2026 17:48:16 -0800
Subject: [PATCH] backend/libinput: fix build with libinput 1.31
Upstream: https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/c1452d88114710f5772662b1d8efb9c71edaa34c
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
backend/libinput/meson.build | 4 ++++
backend/libinput/switch.c | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/backend/libinput/meson.build b/backend/libinput/meson.build
index c244eb77a..091b0e0eb 100644
--- a/backend/libinput/meson.build
+++ b/backend/libinput/meson.build
@@ -29,3 +29,7 @@ features += { 'libinput-backend': true }
wlr_deps += libinput
internal_config.set10('HAVE_LIBINPUT_BUSTYPE', libinput.version().version_compare('>=1.26.0'))
+internal_config.set10(
+ 'HAVE_LIBINPUT_SWITCH_KEYPAD_SLIDE',
+ libinput.version().version_compare('>=1.30.901')
+)
diff --git a/backend/libinput/switch.c b/backend/libinput/switch.c
index abeec86d7..9dde3c9cb 100644
--- a/backend/libinput/switch.c
+++ b/backend/libinput/switch.c
@@ -2,6 +2,7 @@
#include <libinput.h>
#include <wlr/interfaces/wlr_switch.h>
#include "backend/libinput.h"
+#include "config.h"
const struct wlr_switch_impl libinput_switch_impl = {
.name = "libinput-switch",
@@ -36,6 +37,10 @@ void handle_switch_toggle(struct libinput_event *event,
case LIBINPUT_SWITCH_TABLET_MODE:
wlr_event.switch_type = WLR_SWITCH_TYPE_TABLET_MODE;
break;
+#if HAVE_LIBINPUT_SWITCH_KEYPAD_SLIDE
+ case LIBINPUT_SWITCH_KEYPAD_SLIDE:
+ return;
+#endif
}
switch (libinput_event_switch_get_switch_state(sevent)) {
case LIBINPUT_SWITCH_STATE_OFF:
--
GitLab