From 3bbc8a558b4b7289bf68f23c81c1f718f7e4c489 Mon Sep 17 00:00:00 2001 From: Fazzi Date: Wed, 29 Apr 2026 21:47:03 +0100 Subject: [PATCH] Window Rules: add rule --- content/Configuring/Basics/Window-Rules.md | 1 + content/FAQ/_index.md | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/content/Configuring/Basics/Window-Rules.md b/content/Configuring/Basics/Window-Rules.md index eb7bae55..78ee9ed8 100644 --- a/content/Configuring/Basics/Window-Rules.md +++ b/content/Configuring/Basics/Window-Rules.md @@ -185,6 +185,7 @@ Dynamic effects are re-evaluated every time a property changes. | render_unfocused | boolean | Forces the window to think it's being rendered when it's not visible. | | scroll_mouse | number | Forces the window to override `input.scroll_factor`. | | scroll_touchpad | number | Forces the window to override `input.touchpad.scroll_factor`. | +| confine_pointer | boolean | Locks the mouse cursor to the window. Mostly useful for keeping your mouse cursor locked to one monitor during gaming. All dynamic effects can be set with `setprop`. diff --git a/content/FAQ/_index.md b/content/FAQ/_index.md index ae022187..1478bd3e 100644 --- a/content/FAQ/_index.md +++ b/content/FAQ/_index.md @@ -502,3 +502,10 @@ Add `exec-once=xrandr --output [MONITOR_ID] --primary` to your config, replacing By adding this to your hyprland config, it will set the default monitor for X11 applications to your main monitor. +### My mouse cursor keeps escaping the game window! + +Whilst most games should be able to lock your cursor seamlessly, you can lock the cursor from Hyprland's side instead using the `confine_pointer` window rule. To apply this rule to all fullscreen apps with content type 'game', the below rule would suffice: + +```lua +hl.window_rule({ match = { content = "game", fullscreen = true }, confine_pointer = true }) +```