#16318·rustdesk

# [Bug] Linux: uinput virtual mouse reports BUS_USB, disables local touchpad when desktop "disable touchpad on external mouse" is enabled

Author: yomi2539Created Sep 23, 2026Updated Sep 23, 2026
Labelsbug

Bug Description

When the RustDesk service is running on a Linux laptop, the local touchpad stops working if the desktop is configured to disable the touchpad while an external mouse is present (KDE: "Disable touchpad when mouse is plugged in", GNOME: disabled-on-external-mouse, same class of feature).

Root cause: RustDesk creates a virtual uinput mouse named mouce-library-fake-mouse that reports bustype BUS_USB (0x0003). libinput unconditionally tags every USB/Bluetooth pointer device as external (evdev_tag_external_mouse() in src/evdev.c), so the compositor believes a real external mouse is plugged in and suspends the touchpad. No physical mouse is involved.

Evidence from the affected machine:

$ grep . /sys/class/input/event*/device/name | grep -i -E "touchpad|mouce"
event6/device/name: MSFT0001:00 04F3:3140 Touchpad   <- bustype 0018 (I2C), fine
event15/device/name: mouce-library-fake-mouse        <- bustype 0003 (USB), tagged external

$ cat /sys/class/input/event15/device/id/{bustype,vendor,product}
0003
2222
3333
  • /proc/bus/input/devices shows it as Bus=0003 Vendor=2222 Product=3333, handlers mouse2 event15, EV=f, REL=143.
  • Toggling the desktop setting off restores the touchpad immediately; toggling it on kills it again. Reproducible 100%.
  • Kernel receives touchpad events the whole time (interrupt counter keeps growing) — suppression happens purely in libinput's DISABLED_ON_EXTERNAL_MOUSE mode, which KWin enables via libinput_device_config_send_events_set_mode().

Relevant libinput logic (v1.28.1):

c
// src/evdev.c
static void
evdev_tag_external_mouse(struct evdev_device *device,
                         struct udev_device *udev_device)
{
        int bustype;
        bustype = libevdev_get_id_bustype(device->evdev);
        if (bustype == BUS_USB || bustype == BUS_BLUETOOTH)
                device->tags |= EVDEV_TAG_EXTERNAL_MOUSE;
}
c
// src/evdev-mt-touchpad.c, tp_interface_device_added()
if (added_device->tags & EVDEV_TAG_EXTERNAL_MOUSE)
        tp_suspend(tp, device, SUSPEND_EXTERNAL_MOUSE);

How to Reproduce

  1. On a Linux laptop with a touchpad (tested: ELAN I2C touchpad, Debian 13, KDE Plasma 6 / KWin Wayland), enable "disable touchpad when external mouse is plugged in".
  2. Start the RustDesk service (systemctl start rustdesk) — the mouce-library-fake-mouse uinput device appears ~seconds later.
  3. Touchpad stops responding immediately. Stop the service (device disappears) → touchpad works again.

Expected Behavior

The virtual input device used for remote control should not present itself as a physically attached USB mouse. Creating it with BUS_VIRTUAL (0x06) instead of BUS_USB would keep remote control fully functional while no longer tripping libinput's external-mouse detection (nor any compositor feature keyed off it).

Operating system(s) on local (controlling) side and remote (controlled) side

Controlled side (the affected machine): Debian 13 (trixie), KDE Plasma 6 (KWin 6.3.6, Wayland session), kernel 6.12.105+deb13-amd64, libinput 1.28.1, Lenovo Ideapad (ELAN 04F3:3140 I2C touchpad).

RustDesk Version(s) on local (controlling) side and remote (controlled) side

1.4.9 (official .deb, amd64) on the controlled side.

Screenshots

.

Additional Context

No response