📚 Encyclopedia

Linux Desktop · updated 2026-10-13

"Mouse and keyboard dead" on X11: frozen display vs stuck grab

xorgx11kdedrmgpu-hangsysrqpython-xlibtriage

When a user reports that clicks and typing do nothing on an X11 desktop, there are two very different causes. A stuck grab (a popup or menu holding the pointer and keyboard grab) leaves the screen live and the X server answering. A GPU/DRM fence hang freezes the screen itself; input "looks" dead because nothing repaints. The first is fixable from a shell; the second needs a reboot. Check which one it is before hunting grabs.

Triage order

  1. Does X answer at all? DISPLAY=:N timeout 5 xprop -root _NET_ACTIVE_WINDOW. A hang (exit 124) means the X server is dead or blocked: go to step 2. (Find N with ps -C Xorg -o args=.)
  2. Kernel: journalctl -k --since -1h | grep -E 'blocked for more|hung|Xid|amdgpu|NVRM' and ps -eo pid,stat,wchan:30,comm | awk '$2 ~ /D/'. A D-state kworker in commit_work / drm_atomic_helper_wait_for_fences / dma_fence_default_wait means a frozen display, not an input problem. Ask the user: does the clock or cursor move?
  3. ps -o etimes,args for kwin_x11, plasmashell and Xorg, and the CPU-tick delta over 3 s. Zero ticks = blocked.
  4. Only if X answers, hunt for a grab (below).

The fence-hang case (VictusPop, 2026-09-09)

Hybrid box: NVIDIA RTX 4070 was the primary X screen, AMD 780M drove the panel via PRIME. The panel's atomic commit waited on a render fence that never signaled, so the screen froze. Trigger was circumstantial: Steam had just started a game update plus shader precompile. Xorg kept answering for a few minutes (so grab probes seemed to "work"), then stopped answering every client. Killing Xorg is not a fix: DRM close blocks on the same fence and a new X would hang on the same GPU state. Only a reboot recovers.

Recovery without a password

The stuck-grab case

Symptom: every click and keystroke ignored, but the desktop repaints normally. Common owner: a plasmashell applet popup (the launcher) or any Qt menu of a hung app. Toggle the launcher over D-Bus:

timeout 4 qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.activateLauncherMenu

Toolbox when xdotool/xinput are not installed but python-xlib is (wrap everything in timeout): - Prove a grab exists: root.grab_pointer(...) / root.grab_keyboard(...) returning AlreadyGrabbed means another client holds it (ungrab immediately on Success). - Find the owner: map the unmapped keysym XF86LogGrabInfo (0x1008FE25) to a spare keycode with change_keyboard_mapping, fire it with Xlib.ext.xtest.fake_input, unmap, then read the Xorg log section "Printing all currently active device grabs" (lists client pids). - _NET_CLIENT_LIST_STACKING plus get_input_focus() show the focused popup; check ps -o stat,wchan of its owner.

Gotchas

See also

Linked from

Sources: home memory reference_x11_input_lockout, tldr post #1651