Stop the mouse leaving a fullscreen game onto the other monitor
The hyprland-wiki FAQ (content/faq/_index.md, 'My mouse cursor keeps escaping the game window!') gives exactly hl.window_rule({ match = { content = "game", fullscreen = true }, confine_pointer = true }), and the window-rules page documents confine_pointer ('Locks the mouse cursor to the window. Mostly useful for keeping your mouse cursor locked to one monitor during gaming'), the content and fullscreen match props and the class regex prop. Checked against the Hyprland v0.56.2 source: confine_pointer, content and fullscreen are all present in WindowRuleEffectContainer.cpp and Rule.cpp, so the rule works on the version Omarchy 4 ships. The extra class-based rule is a reasonable extension using a documented prop. The verify step's Super+Tab is Omarchy's next-workspace bind in /usr/share/omarchy/default/hypr/bindings/tiling.lua. The canonical FAQ URL https://wiki.hypr.land/FAQ/ is JS-only and was checked through the wiki repo source. Not exercised with a game.
Symptom
In a fullscreen game on a dual-monitor setup, the mouse slides off the edge onto my second screen. Clicking there minimises focus or drops me out of the game. Some games lock the cursor fine, others never do.
Cause
Locking the pointer is up to the game, through the Wayland pointer-constraints protocol or the X11 grab that XWayland translates. Some games, and many running under XWayland, never request or keep a lock. Hyprland can enforce one from its side with the confine_pointer window rule, which locks the cursor to the window.
Fix
Hyprland's own FAQ rule, which confines every fullscreen window that reports content type game. Add to ~/.config/hypr/hyprland.lua (Hyprland 0.55+, Omarchy 4 and current Arch):
hl.window_rule({ match = { content = "game", fullscreen = true }, confine_pointer = true })
Many games do not report a content type, so also match by class (find it with hyprctl clients):
hl.window_rule({ match = { class = "^steam_app_.*", fullscreen = true }, confine_pointer = true })
Reload Hyprland from a keybind or with hyprctl reload, then restart the game.
Verify
In the fullscreen game, push the mouse hard against the edge facing the second monitor: the cursor stays inside the game. Super+Tab or a workspace keybind still switches away.