dmw-nonaturalscroll-20261123.patch (1331B)
1 diff --git i/config.mk w/config.mk 2 index fef9c54..bfc13ba 100644 3 --- i/config.mk 4 +++ w/config.mk 5 @@ -9,7 +9,7 @@ MANPREFIX = ${PREFIX}/share/man 6 PKG_CONFIG = pkg-config 7 SWC_PREFIX != ${PKG_CONFIG} --variable=prefix swc 8 SWC_XML = ${SWC_PREFIX}/share/swc/swc.xml 9 -PKGS = swc wld wayland-server wayland-client xkbcommon 10 +PKGS = swc wld wayland-server wayland-client xkbcommon libinput 11 12 # includes and libs 13 INCS != ${PKG_CONFIG} --cflags ${PKGS} 14 diff --git i/dmw.c w/dmw.c 15 index 45ce7d1..be2bcee 100644 16 --- i/dmw.c 17 +++ w/dmw.c 18 @@ -47,6 +47,7 @@ 19 #include <wayland-server.h> 20 #include <wld/wld.h> 21 #include <xkbcommon/xkbcommon-keysyms.h> 22 +#include <libinput.h> 23 24 #include "util.h" 25 26 @@ -1120,10 +1121,17 @@ signalhandler(int sig, void *data) 27 return 0; 28 } 29 30 +static void 31 +newdevice(struct libinput_device *device) 32 +{ 33 + if (libinput_device_config_scroll_get_methods(device) & LIBINPUT_CONFIG_SCROLL_2FG) 34 + libinput_device_config_scroll_set_natural_scroll_enabled(device, 0); 35 +} 36 + 37 int 38 main(int argc, char **argv) 39 { 40 - static const struct swc_manager manager = { .new_screen = newscreen, .new_window = newwindow }; 41 + static const struct swc_manager manager = { .new_screen = newscreen, .new_window = newwindow, .new_device = newdevice }; 42 const char *socket; 43 struct stat st; 44 struct wl_event_source *signals[3];