AvengeMedia / AvengeMedia/DankMaterialShell
Key input / focus gets stuck after sleep when running DMS
- Dominant language
- QML
- Stars
- 8.1k
- Forks
- 515
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 102
Description
### Compositor
Hyprland
### If Other, please specify
_No response_
### Distribution
CachyOS
### If Other, please specify
_No response_
### Select your Installation Method
DankInstaller
### Was your original Installation method different?
No (specify below)
### If no, specify
_No response_
### dms doctor -vC
Click to expand
## DMS Doctor Report
**System**
- [ok] Operating System: CachyOS
- ID: cachyos, Version: rolling, Arch: amd64
- [ok] Architecture: amd64
- [ok] Display Server: Wayland
- WAYLAND_DISPLAY=wayland-1
**Versions**
- [ok] DMS CLI: dms v1.5.3
- /usr/bin/dms
- [ok] Quickshell: Quickshell 0.3.0 (revision , distributed by Arch Linux)
- /usr/bin/qs
- [ok] DMS Shell: v1.5.3
- /usr/share/quickshell/dms
**Installation**
- [ok] DMS Configuration: Found
- /usr/share/quickshell/dms
- [ok] shell.qml: Present
- /usr/share/quickshell/dms/shell.qml
- [info] Install Type: System package
- /usr/share/quickshell/dms
**Compositor**
- [ok] Hyprland: 0.56.2
- /usr/bin/hyprland
- [ok] mangowc: 0.16.0
- /usr/bin/mango
- [info] Active: Hyprland
- [ok] Background Blur: Supported
- Compositor supports ext-background-effect-v1
**Quickshell Features**
- [ok] Polkit: Available
- Authentication prompts
- [ok] IdleMonitor: Available
- Idle detection
- [ok] IdleInhibitor: Available
- Prevent idle/sleep
- [ok] ShortcutInhibitor: Available
- Allow shortcut management (niri)
- [ok] BackgroundBlur: Available
- Background blur API support in Quickshell
**Optional Features**
- [ok] accountsservice: Available
- User accounts
- [ok] power-profiles-daemon: Available
- Power profile management
- [ok] logind: Available
- Session management
- [warn] cups-pk-helper: Not available (install cups-pk-helper)
- Printer management
- [ok] I2C/DDC: 1 monitor(s) detected
- External monitor brightness control
- [ok] qt6-imageformats: Installed (5 formats)
- Formats: WebP, TIFF, GIF, JP2, ICNS (/usr/lib/qt6/plugins/imageformats:/usr/lib64/qt6/plugins/imageformats)
- [ok] kimageformats: Installed (4 formats)
- Formats: AVIF, HEIF, JXL, EXR (/usr/lib/qt6/plugins/imageformats:/usr/lib64/qt6/plugins/imageformats)
- [ok] Terminal: ghostty, alacritty
- [ok] Network: NetworkManager
- NetworkManager present. Using NM API.
- [ok] matugen: Installed
- Dynamic theming
- [ok] dgop: Installed
- System monitoring
- [warn] cava: Missing
- Audio visualizer
- [info] khal: Not installed
- Calendar events
- [info] danksearch: Not installed
- File search
- [info] dankcalendar: Not installed
- Calendar app
- [ok] fprintd: Installed
- Fingerprint auth
**Config Files**
- [ok] settings.json: Present
- /home/hidekichi/.config/DankMaterialShell/settings.json
- [info] clsettings.json: Not yet created
- /home/hidekichi/.config/DankMaterialShell/clsettings.json
- [info] plugin_settings.json: Not yet created
- /home/hidekichi/.config/DankMaterialShell/plugin_settings.json
- [ok] session.json: Present
- /home/hidekichi/.local/state/DankMaterialShell/session.json
- [ok] dms-colors.json: Present
- /home/hidekichi/.cache/DankMaterialShell/dms-colors.json
**Services**
- [ok] dms.service: enabled, active
- [info] greetd: Not installed
- Optional greeter service
**Environment**
- [info] QT_QPA_PLATFORMTHEME: Not set
- [info] QS_ICON_THEME: Not set
- [warn] XDG_MENU_PREFIX: Not set
- Dolphin file associations and 'Open with…' dialog may be empty. Set XDG_MENU_PREFIX=plasma- in your compositor's environment block.
**Fonts**
- [ok] Normal Font: BIZ UDPゴシック
- Available
- [ok] Monospace Font: Bizin Gothic NF
- Available
---
**Summary:** 0 error(s), 3 warning(s), 33 ok
### Description
I am encountering a keyboard input and keybinding response issue after system sleep or extended keyboard inactivity when running DMS.
**Important Note on System State:**
DMS itself is NOT frozen—mouse and touch interactions remain fully functional. I can still click workspace icons on the DMS UI to switch workspaces, or launch apps from the menu. However, specific keyboard events and `Super`-key shortcuts stop responding.
---
### Behavior Details:
#### 1. Initial State (Default Fcitx5 config, without GTK env vars)
- **Symptom:** After waking from extended sleep, `Super` key shortcuts (switching workspaces/windows), `Left Arrow`, and `Backspace` keys stop working.
- **Impact:** I could not edit config files or fix typos using `Left Arrow` or `Backspace` via keyboard (I had to manually tap the screen to position the caret and use `Delete`).
- **Recovery:**
- Placing the caret in a text editor (before sleep opened) and **holding down `Left Arrow` for a few seconds** eventually "unblocks" the queue, restoring `Super`, `Backspace`, and arrow keys.
- Alternatively, quitting Fcitx5 from the tray menu and launching a fresh instance from the application menu resolves it (simply clicking "Restart" in the tray menu did not work).
#### 2. Current State (With Wayland/GTK environment variables)
- **Symptom:** `Super` shortcuts and standard typing generally work fine now. However, after a period of keyboard inactivity (e.g., performing mouse-only actions like file transfers in LocalSend), certain keys—specifically tested with the top-row number keys—stop responding when I try to type again.
- **Recovery:** In this state, simply selecting **"Restart" from the Fcitx5 tray menu** instantly fixes the issue.
Given that this occurs across different compositors (Hyprland and MangoWM) whenever DMS is running, I suspect there may be a focus/event queue deadlock or release failure related to DMS layer-shell or focus handling during idle/sleep recovery.
### Solutions Tried
1. **Holding Left Arrow Key:** Placing the caret inside an open text editor and holding down the `Left Arrow` key for a few seconds eventually "unblocks" the input queue and restores all key functions.
2. **Restarting Fcitx5:** Quitting and restarting Fcitx5 (via tray menu or `fcitx5 -r`) instantly fixes the issue.
3. **Setting GTK Environment Variables:** Configured `GTK_IM_MODULE="fcitx"` and Wayland-native settings in Fcitx5. While this kept compositor keybindings working after sleep, number keys still randomly stop working after periods of keyboard inactivity (e.g., performing mouse-only operations in LocalSend), which still requires an Fcitx5 restart.
### Configuration Details
- **OS:** CachyOS
- **Compositors tested:** Hyprland, MangoWM
- **IME:** Fcitx5
### Configuration History & Setup
1. **Original Setup (`hyprland.conf` era):**
- Started Fcitx5 directly in `hyprland.conf` via `exec-once = fcitx5 -d`.
- No GTK/IM environment variables were set.
2. **Migration to Lua & Current Setup (`hyprland.lua` via DMS):**
- Following updates that migrated configuration to Lua, I updated the startup call to `hl.exec_cmd("fcitx5 -d")`.
- As a preventive measure and troubleshooting attempt for input issues, I also added GTK and Xwayland environment variables via `hl.env`.
**Current `hyprland.lua` snippet:**
```lua
-- Hyprland configuration (Lua) — [https://wiki.hypr.land/Configuring/Start/](https://wiki.hypr.land/Configuring/Start/)
hl.config({ autogenerated = false })
hl.env("GTK_IM_MODULE", "fcitx")
hl.env("XMODIFIERS", "@im=fcitx")
-- DMS_STARTUP_BEGIN
hl.on("hyprland.start", function()
hl.exec_cmd("dbus-update-activation-environment --systemd --all")
hl.exec_cmd("systemctl --user start hyprland-session.target")
hl.exec_cmd("fcitx5 -d")
end)
-- DMS_STARTUP_END
hl.config({
input = {
kb_layout = "jp",
-- etc.
},
})
```
### Screenshots/Recordings
N/A (This is an input/focus responsiveness issue that cannot be easily captured in a static screenshot).
Contributor guide
Research direction
Start by reproducing the post-sleep and keyboard-inactivity behavior with DMS and Fcitx5, using the reported hyprland.lua setup and comparing compositor behavior. Trace whether DMS layer-shell or focus handling is involved; done means identifying a reproducible cause and verifying that keyboard input and shortcuts recover without restarting Fcitx5.
Written by the indexing model from the issue text.
Assessment
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100