This commit is contained in:
Danny Trunk 2026-07-08 20:30:53 -04:00 committed by GitHub
commit 5e12a6d9aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View File

@ -268,6 +268,20 @@ def setup_uinput():
logger.warning("cannot create uinput device: %s", e)
def teardown_uinput():
global udevice
if udevice is None:
return
try:
udevice.close()
if logger.isEnabledFor(logging.INFO):
logger.info("uinput device closed")
except Exception as e:
logger.warning("cannot close uinput device: %s", e)
finally:
udevice = None
def kbdgroup():
if xkb_setup():
state = XkbStateRec()

View File

@ -23,6 +23,7 @@ from typing import Callable
import gi
import yaml
from logitech_receiver import diversion
from logitech_receiver.common import Alert
from solaar.i18n import _
@ -130,6 +131,8 @@ def _status_changed(device, alert, reason, refresh=False):
alert = Alert.NONE
tray.update(device)
if device.kind is None and not tray._devices_info:
diversion.teardown_uinput()
if alert & Alert.ATTENTION:
tray.attention(reason)