mirror of
https://github.com/wizbright/waybox.git
synced 2025-10-28 05:40:18 -04:00
Fixed oversights in libinput configuration
This commit is contained in:
parent
6c6d0214b4
commit
e4b603a082
9 changed files with 19 additions and 5 deletions
|
|
@ -3,12 +3,13 @@
|
||||||
#
|
#
|
||||||
image: archlinux
|
image: archlinux
|
||||||
packages:
|
packages:
|
||||||
- meson
|
- libevdev
|
||||||
- wayland
|
|
||||||
- wayland-protocols
|
|
||||||
- libinput
|
- libinput
|
||||||
- libxkbcommon
|
- libxkbcommon
|
||||||
- libxml2
|
- libxml2
|
||||||
|
- meson
|
||||||
|
- wayland
|
||||||
|
- wayland-protocols
|
||||||
- wlroots
|
- wlroots
|
||||||
- xorg-server-xwayland
|
- xorg-server-xwayland
|
||||||
sources:
|
sources:
|
||||||
|
|
|
||||||
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
|
@ -18,7 +18,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
pacman-key --init
|
pacman-key --init
|
||||||
pacman -Syu --noconfirm
|
pacman -Syu --noconfirm
|
||||||
pacman -S --noconfirm git meson libxkbcommon libinput libxml2 wayland wayland-protocols wlroots xorg-server-xwayland
|
pacman -S --noconfirm git libevdev libinput libxkbcommon libxml2 meson wayland wayland-protocols wlroots xorg-server-xwayland
|
||||||
# actions/checkout@v2 clones the repository
|
# actions/checkout@v2 clones the repository
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: setup
|
- name: setup
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ contributing.](https://github.com/wizbright/waybox/blob/master/CONTRIBUTING.md)
|
||||||
|
|
||||||
* [Meson](https://mesonbuild.com/)
|
* [Meson](https://mesonbuild.com/)
|
||||||
* [Wayland](https://wayland.freedesktop.org/)
|
* [Wayland](https://wayland.freedesktop.org/)
|
||||||
|
* [libevdev](https://www.freedesktop.org/wiki/Software/libevdev/)
|
||||||
* [libinput](http://www.freedesktop.org/wiki/Software/libinput)
|
* [libinput](http://www.freedesktop.org/wiki/Software/libinput)
|
||||||
* [libxml2](http://xmlsoft.org/)
|
* [libxml2](http://xmlsoft.org/)
|
||||||
* [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots/)
|
* [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots/)
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,7 @@
|
||||||
<leftHanded>disabled</leftHanded>
|
<leftHanded>disabled</leftHanded>
|
||||||
<middleEmulation>enabled</middleEmulation>
|
<middleEmulation>enabled</middleEmulation>
|
||||||
<naturalScroll>disabled</naturalScroll>
|
<naturalScroll>disabled</naturalScroll>
|
||||||
|
<scrollButton>BTN_MIDDLE</scrollButton>
|
||||||
<scrollButtonLock>disabled</scrollButtonLock>
|
<scrollButtonLock>disabled</scrollButtonLock>
|
||||||
<scrollMethod>twofinger</scrollMethod>
|
<scrollMethod>twofinger</scrollMethod>
|
||||||
<tap>enabled</tap>
|
<tap>enabled</tap>
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ cc = meson.get_compiler('c')
|
||||||
# Adding include directory
|
# Adding include directory
|
||||||
inc_dir = include_directories('include')
|
inc_dir = include_directories('include')
|
||||||
|
|
||||||
|
libevdev = dependency('libevdev')
|
||||||
libinput = dependency('libinput', version: '>=1.21.0')
|
libinput = dependency('libinput', version: '>=1.21.0')
|
||||||
libxml2 = dependency('libxml-2.0')
|
libxml2 = dependency('libxml-2.0')
|
||||||
wlroots = dependency('wlroots', version: '>=0.16.0')
|
wlroots = dependency('wlroots', version: '>=0.16.0')
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,7 @@ bool init_config(struct wb_server *server) {
|
||||||
config->libinput_config.left_handed = parse_xpath_expr("//ob:mouse//ob:libinput/ob:leftHanded", ctxt);
|
config->libinput_config.left_handed = parse_xpath_expr("//ob:mouse//ob:libinput/ob:leftHanded", ctxt);
|
||||||
config->libinput_config.middle_emulation = parse_xpath_expr("//ob:mouse//ob:libinput/ob:middleEmulation", ctxt);
|
config->libinput_config.middle_emulation = parse_xpath_expr("//ob:mouse//ob:libinput/ob:middleEmulation", ctxt);
|
||||||
config->libinput_config.natural_scroll = parse_xpath_expr("//ob:mouse//ob:libinput/ob:naturalScroll", ctxt);
|
config->libinput_config.natural_scroll = parse_xpath_expr("//ob:mouse//ob:libinput/ob:naturalScroll", ctxt);
|
||||||
|
config->libinput_config.scroll_button = parse_xpath_expr("//ob:mouse//ob:libinput/ob:scrollButton", ctxt);
|
||||||
config->libinput_config.scroll_button_lock = parse_xpath_expr("//ob:mouse//ob:libinput/ob:scrollButtonLock", ctxt);
|
config->libinput_config.scroll_button_lock = parse_xpath_expr("//ob:mouse//ob:libinput/ob:scrollButtonLock", ctxt);
|
||||||
config->libinput_config.scroll_method = parse_xpath_expr("//ob:mouse//ob:libinput/ob:scrollMethod", ctxt);
|
config->libinput_config.scroll_method = parse_xpath_expr("//ob:mouse//ob:libinput/ob:scrollMethod", ctxt);
|
||||||
config->libinput_config.tap = parse_xpath_expr("//ob:mouse//ob:libinput/ob:tap", ctxt);
|
config->libinput_config.tap = parse_xpath_expr("//ob:mouse//ob:libinput/ob:tap", ctxt);
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ struct wb_config {
|
||||||
char *left_handed;
|
char *left_handed;
|
||||||
char *middle_emulation;
|
char *middle_emulation;
|
||||||
char *natural_scroll;
|
char *natural_scroll;
|
||||||
|
char *scroll_button;
|
||||||
char *scroll_button_lock;
|
char *scroll_button_lock;
|
||||||
char *scroll_method;
|
char *scroll_method;
|
||||||
char *tap;
|
char *tap;
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ wb_src = files(
|
||||||
)
|
)
|
||||||
|
|
||||||
wb_dep = [
|
wb_dep = [
|
||||||
|
libevdev,
|
||||||
libinput,
|
libinput,
|
||||||
libxml2,
|
libxml2,
|
||||||
wayland_server,
|
wayland_server,
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
#include <libevdev/libevdev.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <wlr/backend/libinput.h>
|
#include <wlr/backend/libinput.h>
|
||||||
|
|
@ -287,7 +288,7 @@ static void handle_new_pointer(struct wb_server *server, struct wlr_input_device
|
||||||
enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
|
enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
|
||||||
if (strcmp(config->libinput_config.click_method, "clickfinger") == 0)
|
if (strcmp(config->libinput_config.click_method, "clickfinger") == 0)
|
||||||
click_method = LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
|
click_method = LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
|
||||||
else if (strcmp(config->libinput_config.scroll_method, "none") == 0)
|
else if (strcmp(config->libinput_config.click_method, "none") == 0)
|
||||||
click_method = LIBINPUT_CONFIG_CLICK_METHOD_NONE;
|
click_method = LIBINPUT_CONFIG_CLICK_METHOD_NONE;
|
||||||
libinput_device_config_click_set_method(libinput_handle, click_method);
|
libinput_device_config_click_set_method(libinput_handle, click_method);
|
||||||
}
|
}
|
||||||
|
|
@ -311,6 +312,12 @@ static void handle_new_pointer(struct wb_server *server, struct wlr_input_device
|
||||||
libinput_device_config_scroll_set_natural_scroll_enabled(libinput_handle,
|
libinput_device_config_scroll_set_natural_scroll_enabled(libinput_handle,
|
||||||
libinput_config_get_enabled(config->libinput_config.natural_scroll));
|
libinput_config_get_enabled(config->libinput_config.natural_scroll));
|
||||||
}
|
}
|
||||||
|
if (config->libinput_config.scroll_button) {
|
||||||
|
int button = libevdev_event_code_from_name(EV_KEY, config->libinput_config.scroll_button);
|
||||||
|
if (button != -1) {
|
||||||
|
libinput_device_config_scroll_set_button(libinput_handle, button);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (config->libinput_config.scroll_button_lock) {
|
if (config->libinput_config.scroll_button_lock) {
|
||||||
libinput_device_config_scroll_set_button_lock(libinput_handle,
|
libinput_device_config_scroll_set_button_lock(libinput_handle,
|
||||||
libinput_config_get_enabled(config->libinput_config.scroll_button_lock));
|
libinput_config_get_enabled(config->libinput_config.scroll_button_lock));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue