[Touchpad] The option "Disable While Typing" is not taken into account
Summary
Touchpad dwt deactivation is not taken into account by libinput
Steps to reproduce
#include <fcntl.h>
#include <unistd.h>
#include <iostream>
#include <libinput.h>
#include <X11/Xlib.h>
int main()
{
struct libinput_interface interface;
struct udev* udev = udev_new();
interface.open_restricted =
[](const char* path, int flags, void* userdata) -> int {
flags |= O_CLOEXEC;
int fd = open(path, flags);
return fd;
};
interface.close_restricted = [](int fd, void* userdata) { close(fd); };
struct libinput* handle =
libinput_udev_create_context(&interface, nullptr, udev);
Display* dpy = XOpenDisplay(nullptr);
libinput_udev_assign_seat(handle, "seat0");
struct libinput_event* ev;
enum libinput_event_type evtype;
libinput_dispatch(handle);
while ((ev = libinput_get_event(handle))) {
evtype = libinput_event_get_type(ev);
switch (evtype) {
case LIBINPUT_EVENT_DEVICE_ADDED: {
if (struct libinput_device* dev = libinput_event_get_device(ev);
dev) {
if (libinput_device_has_capability(
dev, LIBINPUT_DEVICE_CAP_POINTER)) {
std::string deviceName = libinput_device_get_name(dev);
if (deviceName.find("Touchpad") != std::string::npos) {
std::cout << "device name: "
<< libinput_device_get_name(dev)
<< std::endl;
if (libinput_device_config_dwt_is_available(dev)) {
std::cout
<< "\tdwt is "
<< (libinput_device_config_dwt_get_enabled(
dev) == LIBINPUT_CONFIG_DWT_ENABLED
? "enabled"
: "disabled")
<< std::endl;
std::cout
<< "\tdefault dwt is "
<< (libinput_device_config_dwt_get_default_enabled(
dev) == LIBINPUT_CONFIG_DWT_ENABLED
? "enabled"
: "disabled")
<< std::endl;
}
}
}
}
}
default: break;
}
libinput_event_destroy(ev);
}
libinput_unref(handle);
udev_unref(udev);
return 0;
}
List of command lines I've made:
$> xinput | grep Touchpad
⎜ ↳ ELAN0674:00 04F3:3193 Touchpad id=11 [slave pointer (2)]
$> xinput list-props 11 | grep "Disable While Typing"
libinput Disable While Typing Enabled (356): 0
libinput Disable While Typing Enabled Default (357): 1
$> g++ main.cpp -lX11 -linput -ludev
$> ./a.out
device name: ELAN0674:00 04F3:3193 Touchpad
dwt is enabled
default dwt is enabled
Required information
- libinput version: 1.23
- hardware information: Ubuntu 23.10 Gnome X11