[[email protected]] Peripheral misclassification and device alias swapping on Logitech Unifying receivers

Aperta
#14,113 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 8 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, linux, python
Ambito
backend, desktop

Direzione di ricerca

Start with applets/[email protected]/applet.js and cinnamon-settings/modules/cs_power.py, especially _devicesChanged(), DeviceItem alias resolution, build_battery_page(), and create_battery_row(). Check how device model, device_kind, and device_id are used for labels and aliases; the report includes a GetDevices example showing both peripherals classified as keyboards. Done when the mouse is identified correctly and aliases stay attached to the right peripherals after device enumeration changes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

BUG
Distribution

Arch Linux (Linux kernel 7.2, Wayland session: cinnamon-wayland)

Package version

cinnamon 6.8.0-2

Graphics hardware in use

Intel Corporation IvyBridge GT2 [HD Graphics 4000] (i915 driver)

Frequency

Always

Bug description

When multiple wireless peripherals (a mouse and a keyboard) are paired to a single composite USB receiver (such as a Logitech Unifying or Bolt receiver), two related issues affect the Cinnamon Power applet ([email protected]) and Power Settings (cs_power.py):

1. Misclassification in panel tooltip and icons:
The panel tooltip displays "Keyboard (100%), Keyboard (5%)" because UPower defaults the mouse battery type to UPDeviceKind.KEYBOARD (6) due to the shared USB receiver. However, UPower's Model string correctly reports "Logitech Wireless Mouse". The Cinnamon applet relies strictly on device_kind and ignores the known model name, showing duplicate keyboard icons and tooltips.

2. Random device alias swap / inversion:
When custom device nicknames (aliases) are set in Cinnamon Power Settings, Cinnamon binds them to transient D-Bus object paths (e.g. `/org/freedesktop/UPower/devices/keyboard_hidpp_battery_0`). Because device enumeration order is dynamic (it depends on whether the mouse or keyboard transmits first after boot or wakeup), these numbers swap. This causes the keyboard alias to be applied to the mouse, actively inverting the peripherals in the menu.
Steps to reproduce
1. Pair both a Logitech wireless mouse and a wireless keyboard to a single Logitech Unifying USB receiver.
2. Observe the Cinnamon Power applet tooltip: it displays "Keyboard (XX%), Keyboard (YY%)".
3. Open Cinnamon Settings -> Power and set friendly nicknames (aliases) for the mouse and keyboard.
4. Reboot the computer or wake it up from sleep, moving the mouse first to wake it before typing on the
keyboard.
5. The device numbers assigned by the kernel/UPower invert (_0 becomes _1), causing Cinnamon to assign        the keyboard alias to the mouse and vice-versa.
Expected behavior
1. `[email protected]` should inspect the `model` property (e.g. check if model contains "mouse" or
"keyboard") as an override or fallback to determine the appropriate icon and tooltip string, rather than
relying exclusively on UPower's raw `device_kind`.
2. Device aliases in Cinnamon should be keyed or matched by hardware model / serial number rather than
transient D-Bus object paths (`battery_hidpp_battery_X`) that change order between boots.
Additional information
Output of `busctl --user call org.cinnamon.SettingsDaemon.Power /org/cinnamon/SettingsDaemon/Power
org.cinnamon.SettingsDaemon.Power GetDevices`:

a(sssusduut) 2
  "/org/freedesktop/UPower/devices/keyboard_hidpp_battery_3" "" "Logitech K540/K545" 6 ... 100 ...
  "/org/freedesktop/UPower/devices/keyboard_hidpp_battery_2" "" "Logitech Wireless Mouse" 6 ... 5 ...

Notice both devices have device_kind = 6 (keyboard) from UPower, but model unambiguously identifies "Logitech  Wireless Mouse".

Relevant code locations:
- applets/[email protected]/applet.js:
  - stats generation in _devicesChanged(): PowerUtils.deviceKindToString(device_kind)
  - DeviceItem alias resolution: if (parts[0] == device_id) (matching only volatile D-Bus paths)
- cinnamon-settings/modules/cs_power.py:
  - build_battery_page() and create_battery_row() mapping aliases strictly by device_id.
Lingua principale
JavaScript
Stelle
5.7k
Fork
941
Merge medio
7g 9h
PR unite (30g)
13

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di linuxmint/cinnamon

Tutte le issue di linuxmint/cinnamon

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.