mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-11-08 21:07:19 +00:00
[client] evdev: fix input capture and device handling
Classify configured devices by keyboard and pointer capability so automatic keyboard capture leaves relative pointer devices with the display server. Run descriptor, grab, physical-state, and LED operations on one worker. Marshal normalized events through each display server's event loop and serialize ownership changes with per-lane barriers. Fall back whole lanes to native input when an evdev cohort cannot be owned, and retry missing or removed devices without disabling the rest. Handle report framing, SYN_DROPPED, high-resolution wheels, queue overflow, held-state cleanup, and guest-driven keyboard LEDs. Restore host LEDs and kernel grabs during teardown. Re-evaluate capture when the active input transport changes.
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "kb.h"
|
||||
#include "message.h"
|
||||
#include "input.h"
|
||||
#include "evdev.h"
|
||||
|
||||
#include "common/time.h"
|
||||
#include "common/debug.h"
|
||||
@@ -140,6 +141,8 @@ bool core_inputEnabled(void)
|
||||
void core_updateKeyboardGrab(void)
|
||||
{
|
||||
const bool inputEnabled = core_inputEnabled();
|
||||
const bool localActive = g_state.focused && !app_isOverlayMode() &&
|
||||
!g_state.ignoreInput;
|
||||
/* Explicit capture is local window state and must survive an input provider
|
||||
* becoming unavailable or changing during startup. */
|
||||
const bool capture = g_cursor.grab && g_params.grabKeyboard &&
|
||||
@@ -150,6 +153,7 @@ void core_updateKeyboardGrab(void)
|
||||
const bool active = g_state.focused && !app_isOverlayMode() &&
|
||||
(capture || (inputEnabled && (view || automatic)));
|
||||
|
||||
evdev_setGrab(active, localActive && g_cursor.grab);
|
||||
if (active)
|
||||
g_state.ds->grabKeyboard();
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user