Skip to content

Keyboard stops responding normally while playing mouse focused games #1760

Description

@zefrof

I'm encountering an issue with games that have a permanent mouse cursor. Examples being BG3 and Tabletop Simulator. The keyboard stops responding properly and niri get stuck in something resembling a command mode. For example I can drag windows around like super is being held. I suspect this is a niri issue because it affects wayland windows once it starts and happens regardless of if the game is running under xwayland-satellite or gamescope.

I'm running an almost identical config on my laptop (intel cpu/gpu) and don't experience this issue. I also didn't see it on Cosmic. Disabling VRR had no affect. I'm not sure how to continue troubleshooting this, so I'm looking for suggestions.

journalctl output:

-- Boot b23528d792844028a4134f388af716cd --
Jun 03 21:07:01 lumar systemd[1792]: Starting A scrollable-tiling Wayland compositor...
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.239747Z  INFO niri: starting version stable v25.02 (commit b94a5db8790339cf9134873d8b490be69e02ac71)
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.246849Z DEBUG niri_config: loaded config from "/home/zefrof/.config/niri/config.kdl"
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.423757Z  INFO niri::backend::tty: using as the render node: "/dev/dri/renderD128"
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.461527Z DEBUG niri::backend::tty: device added: 57857 "/dev/dri/card1"
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.760356Z DEBUG niri::backend::tty: this is the primary node
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.760374Z DEBUG niri::backend::tty: this is the primary render node
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.792294Z DEBUG niri::backend::tty: device changed: 57857
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.798791Z DEBUG niri::backend::tty: new connector: DP-1 "Dell Inc. DELL S2721DGF CHGY123"
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.798826Z DEBUG niri::backend::tty: new connector: DP-2 "Samsung Electric Company S24E450 HCLH406839"
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.798845Z DEBUG niri::backend::tty: connecting connector: DP-1
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.798873Z DEBUG niri::backend::tty: picking mode: Mode { name: "2560x1440", clock: 645000, size: (2560, 1440), hsync: (2568, 2600, 2640), vsync: (1446, 1454, 1480), hskew: 0, vscan: 0, vrefresh: 165, mode_type: ModeTypeFlags(DR>
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.798945Z DEBUG niri::backend::tty: set max bpc to 8
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.800867Z DEBUG niri::niri: putting output DP-1 at x=0 y=0
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.800878Z DEBUG niri::backend::tty: connecting connector: DP-2
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.800904Z DEBUG niri::backend::tty: picking mode: Mode { name: "1920x1080", clock: 148500, size: (1920, 1080), hsync: (2008, 2052, 2200), vsync: (1084, 1089, 1125), hskew: 0, vscan: 0, vrefresh: 60, mode_type: ModeTypeFlags(PRE>
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.800959Z DEBUG niri::backend::tty: set max bpc to 8
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.801784Z DEBUG niri::niri: putting output DP-2 at x=2560 y=0
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.801828Z  INFO niri: listening on Wayland socket: wayland-1
Jun 03 21:07:01 lumar niri[1831]: 2025-06-04T02:07:01.801833Z  INFO niri: IPC listening on: /run/user/1000/niri.wayland-1.1831.sock
Jun 03 21:07:01 lumar systemd[1792]: Started A scrollable-tiling Wayland compositor.
Jun 03 21:07:12 lumar niri[1831]: 2025-06-04T02:07:12.318757Z DEBUG niri::backend::tty: device changed: 57857
Jun 03 21:07:12 lumar niri[1831]: 2025-06-04T02:07:12.323267Z DEBUG niri::backend::tty: disconnecting connector: "DP-2"
Jun 03 21:07:26 lumar niri[1831]: 2025-06-04T02:07:26.143933Z DEBUG niri::backend::tty: device changed: 57857
Jun 03 21:07:26 lumar niri[1831]: 2025-06-04T02:07:26.151692Z DEBUG niri::backend::tty: new connector: DP-2 "Samsung Electric Company S24E450 HCLH406839"
Jun 03 21:07:26 lumar niri[1831]: 2025-06-04T02:07:26.151712Z DEBUG niri::backend::tty: connecting connector: DP-2
Jun 03 21:07:26 lumar niri[1831]: 2025-06-04T02:07:26.151743Z DEBUG niri::backend::tty: picking mode: Mode { name: "1920x1080", clock: 148500, size: (1920, 1080), hsync: (2008, 2052, 2200), vsync: (1084, 1089, 1125), hskew: 0, vscan: 0, vrefresh: 60, mode_type: ModeTypeFlags(PRE>
Jun 03 21:07:26 lumar niri[1831]: 2025-06-04T02:07:26.151799Z DEBUG niri::backend::tty: set max bpc to 8
Jun 03 21:07:26 lumar niri[1831]: 2025-06-04T02:07:26.153684Z DEBUG niri::niri: putting output DP-2 at x=2560 y=0
Jun 03 21:07:26 lumar niri[1831]: 2025-06-04T02:07:26.829720Z DEBUG niri::backend::tty: device changed: 57857
Jun 03 21:07:27 lumar niri[1831]: 2025-06-04T02:07:27.380350Z DEBUG niri::backend::tty: device changed: 57857
Jun 03 21:22:23 lumar niri[1831]: 2025-06-04T02:22:23.821046Z  WARN niri::backend::tty: error queueing frame: The underlying drm surface encountered an error: DRM access error: Page flip commit failed on device `Some("/dev/dri/card1")` (Permission denied (os error 13))
Jun 03 21:22:23 lumar niri[1831]: 2025-06-04T02:22:23.821385Z  WARN niri::backend::tty: error queueing frame: The underlying drm surface encountered an error: DRM access error: Page flip commit failed on device `Some("/dev/dri/card1")` (Permission denied (os error 13))
Jun 03 21:22:23 lumar niri[1831]: 2025-06-04T02:22:23.821435Z DEBUG niri::backend::tty: pausing session
Jun 03 21:22:23 lumar niri[1831]: 2025-06-04T02:22:23.822916Z  WARN niri::backend::tty: device is inactive
Jun 03 21:22:23 lumar niri[1831]: 2025-06-04T02:22:23.822944Z  WARN niri::backend::tty: device is inactive
Jun 03 21:22:23 lumar niri[1831]: 2025-06-04T02:22:23.842494Z  WARN niri::backend::tty: device is inactive
Jun 03 21:22:23 lumar niri[1831]: 2025-06-04T02:22:23.860671Z  WARN niri::backend::tty: device is inactive

The line device is inactive repeats until I force a shutdown.

config:

input {
    keyboard {
        xkb {
            layout ""
            model ""
            rules ""
            variant ""
        }
        repeat-delay 600
        repeat-rate 25
        track-layout "global"
    }
    touchpad {
        natural-scroll
        accel-speed 0.000000
        accel-profile "flat"
        click-method "clickfinger"
    }
    mouse {
        accel-speed 0.000000
        accel-profile "flat"
    }
    trackpoint { accel-speed 0.000000; }
    trackball { accel-speed 0.000000; }
    tablet
    touch
    focus-follows-mouse
}
output "DP-1" {
    transform "normal"
    mode "2560x1440"
}
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
layout {
    gaps 16
    struts {
        left 0
        right 0
        top 0
        bottom 0
    }
    focus-ring {
        width 4
        active-color "#631334"
        inactive-color "rgb(80 80 80)"
    }
    border { off; }
    insert-hint { color "rgb(127 200 255 / 50%)"; }
    default-column-width
    center-focused-column "never"
}
cursor {
    xcursor-theme "default"
    xcursor-size 24
}
hotkey-overlay
environment { DISPLAY ":12"; }
binds {
    Mod+0 { focus-workspace 0; }
    Mod+1 { focus-workspace 1; }
    Mod+2 { focus-workspace 2; }
    Mod+3 { focus-workspace 3; }
    Mod+4 { focus-workspace 4; }
    Mod+5 { focus-workspace 5; }
    Mod+6 { focus-workspace 6; }
    Mod+7 { focus-workspace 7; }
    Mod+8 { focus-workspace 8; }
    Mod+9 { focus-workspace 9; }
    Mod+BracketLeft { consume-or-expel-window-left; }
    Mod+BracketRight { consume-or-expel-window-right; }
    Mod+C { center-column; }
    Mod+Comma { consume-window-into-column; }
    Mod+Ctrl+0 { move-column-to-workspace 0; }
    Mod+Ctrl+1 { move-column-to-workspace 1; }
    Mod+Ctrl+2 { move-column-to-workspace 2; }
    Mod+Ctrl+3 { move-column-to-workspace 3; }
    Mod+Ctrl+4 { move-column-to-workspace 4; }
    Mod+Ctrl+5 { move-column-to-workspace 5; }
    Mod+Ctrl+6 { move-column-to-workspace 6; }
    Mod+Ctrl+7 { move-column-to-workspace 7; }
    Mod+Ctrl+8 { move-column-to-workspace 8; }
    Mod+Ctrl+9 { move-column-to-workspace 9; }
    Mod+Ctrl+Down { move-window-down; }
    Mod+Ctrl+End { move-column-to-last; }
    Mod+Ctrl+H { move-column-left; }
    Mod+Ctrl+Home { move-column-to-first; }
    Mod+Ctrl+I { move-column-to-workspace-up; }
    Mod+Ctrl+J { move-window-down; }
    Mod+Ctrl+K { move-window-up; }
    Mod+Ctrl+L { move-column-right; }
    Mod+Ctrl+Left { move-column-left; }
    "Mod+Ctrl+Page_Down" { move-column-to-workspace-down; }
    "Mod+Ctrl+Page_Up" { move-column-to-workspace-up; }
    Mod+Ctrl+R { reset-window-height; }
    Mod+Ctrl+Right { move-column-right; }
    Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
    Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
    Mod+Ctrl+U { move-column-to-workspace-down; }
    Mod+Ctrl+Up { move-window-up; }
    Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
    Mod+Ctrl+WheelScrollLeft { move-column-left; }
    Mod+Ctrl+WheelScrollRight { move-column-right; }
    Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
    Mod+D { spawn "fuzzel"; }
    Mod+Down { focus-window-down; }
    Mod+End { focus-column-last; }
    Mod+Equal { set-column-width "+10%"; }
    Mod+F { maximize-column; }
    Mod+H { focus-column-left; }
    Mod+Home { focus-column-first; }
    Mod+I { focus-workspace-up; }
    Mod+J { focus-window-down; }
    Mod+K { focus-window-up; }
    Mod+L { focus-column-right; }
    Mod+Left { focus-column-left; }
    Mod+Minus { set-column-width "-10%"; }
    "Mod+Page_Down" { focus-workspace-down; }
    "Mod+Page_Up" { focus-workspace-up; }
    Mod+Period { expel-window-from-column; }
    Mod+R { switch-preset-column-width; }
    Mod+Right { focus-column-right; }
    Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
    Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
    Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
    Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
    Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
    Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
    Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
    Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
    Mod+Shift+Down { focus-monitor-down; }
    Mod+Shift+E { quit; }
    Mod+Shift+Equal { set-window-height "+10%"; }
    Mod+Shift+F { fullscreen-window; }
    Mod+Shift+H { focus-monitor-left; }
    Mod+Shift+I { move-workspace-up; }
    Mod+Shift+J { focus-monitor-down; }
    Mod+Shift+K { focus-monitor-up; }
    Mod+Shift+L { focus-monitor-right; }
    Mod+Shift+Left { focus-monitor-left; }
    Mod+Shift+Minus { set-window-height "-10%"; }
    "Mod+Shift+Page_Down" { move-workspace-down; }
    "Mod+Shift+Page_Up" { move-workspace-up; }
    Mod+Shift+Q { close-window; }
    Mod+Shift+R { switch-preset-window-height; }
    Mod+Shift+Right { focus-monitor-right; }
    Mod+Shift+S { screenshot; }
    Mod+Shift+Slash { show-hotkey-overlay; }
    Mod+Shift+U { move-workspace-down; }
    Mod+Shift+Up { focus-monitor-up; }
    Mod+Shift+V { switch-focus-between-floating-and-tiling; }
    Mod+Shift+WheelScrollDown { focus-column-right; }
    Mod+Shift+WheelScrollUp { focus-column-left; }
    Mod+T { spawn "alacritty"; }
    Mod+U { focus-workspace-down; }
    Mod+Up { focus-window-up; }
    Mod+V { toggle-window-floating; }
    Mod+W { toggle-column-tabbed-display; }
    Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
    Mod+WheelScrollLeft { focus-column-left; }
    Mod+WheelScrollRight { focus-column-right; }
    Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
    Super+Alt+L { spawn "swaylock"; }
    XF86AudioLowerVolume { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; }
    XF86AudioMute { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
    XF86AudioRaiseVolume { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; }
    XF86MonBrightnessDown { spawn "brightnessctl" "set" "-5%"; }
    XF86MonBrightnessUp { spawn "brightnessctl" "set" "+5%"; }
}
spawn-at-startup "xwayland-satellite" ":12"
window-rule {
    match app-id="Alacritty"
    draw-border-with-background false
}
animations { slowdown 1.000000; }

This config is generated by my nixos config: https://gitlab.com/zefrof/nixos-configs
Relevant config files: home/niri-{output, settings}.nix and modules/niri.nix. Possibly notable is my laptop doesn't use home/niri-output.nix.

System Information

  • niri version: niri stable v25.02 (commit b94a5db)

  • Distro: nixos

  • GPU: AMD 5700XT

  • CPU: AMD Ryzen 3800X

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions