hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.97k stars 913 forks source link

Focus cursor on the window #7641

Open r3t4k3r opened 3 months ago

r3t4k3r commented 3 months ago

Description

Note: i use 2 display setup

  1. I start the game (using wine)
  2. I set up fullscreen for game window
  3. Mouse and keyboard focused on window, but when i move cursor into another display direction, cursor leave the window and goes to second display. But i want to still fixed on window

I already tried these window rules:

windowrulev2 = windowdance, fullscreen:(.*1.*)
windowrulev2 = forceinput, fullscreen:(.*1.*)
windowrulev2 = fakefullscreen, fullscreen:(.*1.*)

But it still not working. I don't know is Hyprland already has a feature to fix cursor on window or not. Rules above work, but them don't help to solve my problem.

Best wishes, r3t4k3r.

n1flh31mur commented 3 months ago

Same thing, I haven't seen this behavior before 41-42 version.

Aqa-Ib commented 3 months ago

Would be nice to have a dispatcher to make the cursor exclusive to a window.

However, video games have this option in the game's menu. Have you tried it ?

r3t4k3r commented 3 months ago

However, video games have this option in the game's menu. Have you tried it ?

That is old game "Bully", in settings game hasn't option for fix cursor, i also tried to change wine environment, but it also didn't help me

Would be nice to have a dispatcher to make the cursor exclusive to a window.

Good idea

n1flh31mur commented 3 months ago

Tried to play Elden Ring, Abiotic Factor and Deadlock. Same issue in all games with using fullscreen, windowed in game and tried with gamescope. Result the same.

Maybe I will try to experiment more with gamescope, but it would be great to run games without any "spikes". 😋

n1flh31mur commented 2 months ago

Tried today rebuild Hyprland from sources by myself, without official Arch hyprland package and without hyprland-git.

With such game launch options everything works fine:

gamescope -W 3440 -H 1440 --force-grab-cursor %command%