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.32k stars 897 forks source link

Mouse constraints/locking isn't implemented. #17

Closed vaxerski closed 2 years ago

vaxerski commented 2 years ago

Especially games, which use the cursor for looking around, e.g. shooters, minecraft, etc. Cannot lock the mouse and thus are unplayable.

vaxerski commented 2 years ago

le fixed with 7b1eaca84014d88a420bcbd3f97467f74e82ab33

FlyingStitchman commented 2 years ago

Just tested, this does not seem to work with multiple monitors. On the directions that another monitor exists, the mouse can leave the game window and enter the other monitor. I did not see an option in the wiki, so I assumed that locking would be implemented on any fullscreen window. The other directions (ones without adjacent monitors) work fine. I tried both Risk of Rain 2 and No Mans Sky.

vaxerski commented 2 years ago

I only tried minecraft :P

a game has to request a mouse constraint, but I'll look into it. thanks.

FlyingStitchman commented 2 years ago

Just loaded up minecraft, the multi-monitor issues i mentioned are present.

vaxerski commented 2 years ago

on non-fullscreen too???

FlyingStitchman commented 2 years ago

Window locking only seems to work when the border of the window is the exact same as the border of the entire desktop resolution. If a window is not fullscreen, it does not seem to work (only tested minecraft). If a window is fullscreen, but there is an adjacent screen, the mouse cursor can enter the adjacent screen, although the other sides without an adjacent screen work fine.

vaxerski commented 2 years ago

it worked for me perfectly, weirdd will test more tmr

FlyingStitchman commented 2 years ago

I just tried recompiling it and it now works (mind you I cloned and compiled it already, but apparently it was not happy for some reason).

FlyingStitchman commented 2 years ago

Apologies for reopening this for an unwarranted reason.

vaxerski commented 2 years ago

chill, no worries

Mikilio commented 1 year ago

I also apologize for reopening this issue. Unfortunately the issue arises also with league of legends installed through lutris. I'm using NixOS.

vaxerski commented 1 year ago

Expected behavior, we don't want users playing league of legends.

Mikilio commented 1 year ago

Expected behavior, we don't want users playing league of legends.

I apologize if you have to download the game for debugging.

vaxerski commented 1 year ago

There is no debugging needed. It's, again, intended behavior.

Mikilio commented 1 year ago

Unless you think there is nothing wrong with the code I will have to reopen the issue. I really didn't want to act like a Karen but I saw no other way. (quitting league has been considered)

fortbis commented 10 months ago

@vaxerski Hello, there is a problem in the native game War thunder. Having several monitors, when moving, the cursor goes outside the game on another monitor. No rules with windows do not help. Can you please advise me how I can help with a fix?

fortbis commented 10 months ago

Also I can't use gamescope, with nvidia I get 0 fps......

yCocoJamboo commented 10 months ago

@fortbis At this point, I don't know how to solve this problem. https://community.gaijin.net/issues/p/warthunder/i/uIasWrliZP8o?comment=gBM9sWds2BnwtrHtHspnqGi7

fortbis commented 10 months ago

Is it possible to use a window manager to implement window locking? Like a window rule for example? I'm interested in any solution, thanks!

yCocoJamboo commented 10 months ago

@fortbis https://github.com/hyprwm/Hyprland/issues/1732#issuecomment-1595819110

fortbis commented 10 months ago

@vaxerski Is it possible to implement a rule (monitor position script) only for a specific workspace? I apologize if I didn't notice something before I asked the question.

vaxerski commented 10 months ago

you can probably script that with socket2.

Also, please don't necropost, this issue has been solved for over 1.5 year.