Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-monitor setups and "mouselock" or "cursorlock" #463

Closed
abrahimladha opened this issue Jun 29, 2018 · 22 comments
Closed

Multi-monitor setups and "mouselock" or "cursorlock" #463

abrahimladha opened this issue Jun 29, 2018 · 22 comments

Comments

@abrahimladha
Copy link

I believe this is an issue with DXVK and some unexpected behavior. DXVK has worked great so far in the few games I have tested. If you have a third person or first person game, usually the mouse cursor will be "locked" to the center of the screen and hidden, until you switch applications and then its automatically shown and unlocked. In single monitor mode this does not matter, as if you move your hidden cursor around, you don't notice. If you have more than one monitor, and a game in fullscreen on one monitor, you can see your mouse move onto the second monitor. This should not happen. Your mouse should stay fixed onto the application.

In some games and vanilla wine, In multimonitor mode, my mouse is not locked in place, but it also cannot leave the application window that is in fullscreen.

Sorry I don't have any logs or anything, I think this is just something that has not been implemented yet.

Here are some unrelated links describing "mouselock" or variants of:
https://www.chromium.org/developers/design-documents/mouse-lock
https://docs.unity3d.com/ScriptReference/Screen-lockCursor.html

@jarrard
Copy link

jarrard commented Jun 29, 2018

It's a complicated issue and related to window managers themselves. I have had issues with mouse screen/window locking before but recent kwin/kde updates have resolved it for the most part.

Also be sure winecfg has capture mouse enabled. You need to play around with a few settings until you find what works for you. Sometimes you can fix the issue by running the game in a Virtual Window etc..

@doitsujin
Copy link
Owner

doitsujin commented Jun 29, 2018

I'm not sure if DXVK actually has to deal with locking the mouse, and if so, under which circumstances. I would expect applications to do that when needed, and winecfg already provides a toggle for it.

@Mushoz
Copy link

Mushoz commented Jun 29, 2018

Are you using Wayland by any chance? I had similar issues until I reverted back to Xorg.

Edit: Using dual monitors myself just FYI. And all is working just fine.

@Bfgeshka
Copy link

You didn't say if you tested these games without dxvk.

A lot of games are prone to this kind of issues by design, regardless if it is windows or linux.

@jarrard
Copy link

jarrard commented Jun 29, 2018

The windows10 creators content update actually broke cursor-lock for background mouse (menu cursor in game) for many games and also in general for a select few (ie fallout4).

I resolved this under Windows10 by using a program called cursor lock believe it or not, you need to lock it to interior of a program window for it to work so its a bit fiddly (other settings didn't work). This application may work under wine as a last resort.

PS. I think MS fixed the cursor locking issue with a update. But it was there with windows 1803.

@byaka
Copy link

byaka commented Jun 30, 2018

@jarrard i'll check this app, but dont think any chance that it can work in wine

@maximt
Copy link

maximt commented Jul 12, 2018

I have same problem.

Linux Antergos 4.17.5-1-ARCH #1 SMP PREEMPT Sun Jul 8 17:27:31 UTC 2018 x86_64 GNU/Linux
wine-3.12 (Staging), capture mouse enabled
dxvk-git 20180611.f8650c1-2
game Fallout4

Tested DE: MATE, Cinnamon, KDE, Xfce, Gnome, Deepin.
Wine without DXVK works fine on all DE (mouse is captured), but wine with DXVK dont works any DE (mouse is not captured).

@byaka
Copy link

byaka commented Jul 12, 2018

@maximt hmm this rly strange. i cant confirm this - have same problem with and without dxvk. wine-3.10 Unity 7.
Think we need more tests.

@doitsujin
Copy link
Owner

doitsujin commented Jul 12, 2018

I'm still not convinced that dxvk needs to handle this. DXGI does not grab the mouse by default for fullscreen windows, this is the game's responsibility.

@xpander69
Copy link
Contributor

xpander69 commented Jul 14, 2018

No issues for me with MATE (Marco WM) 2x 2560x1440 screens, mouse captures nicely when i get back into the games. its probably a WM/configuration issue somewhere
i don't run wine virtual windows.

edit: most games you bring up the menu with escape key to release the mouse and go into the other monitor, then coming back and closing the escape menu and its locked in nicely again. there are few games where escape menu doesnt unlock the mouse, in this case you alt+tab or switch workspace with keyboard shortcuts to leave the application and then when you return to it, it locks nicely again.

can anyone point a game where it doesnt lock correctly? i have played lots of games and never seen this happen.

@abrahimladha
Copy link
Author

As far as using the winecfg setting to capture the mouse, that always captures the mouse. Usually you want the mouse to be free during menus and certain things, and then to become locked again during 1st or 3rd person gameplay. Enabling this means you cant click around in the menus.

I don't really know who the responsibility would fall on, but I decided to report it here since mouse capture works fine under vanilla wine, but if I use DXVK it seems to have an issue.

@doitsujin
Copy link
Owner

doitsujin commented Jul 14, 2018

Someone would have to figure out why this works on wined3d but not on DXVK, and under which circumstances exactly this problem appears.

I'm not doing anything input-related, so I'm not sure why this happens, and I haven't managed to reproduce this locally yet with any of my games. Still not sure if this is really my bug because, as mentioned, DXVK should not affect input management in any way at all.

@byaka
Copy link

byaka commented Jul 16, 2018

for me this problem happens with and without dxvk.
but today i tested Battlefield BC2 and it have another strange issue - without dxvk fullscreen works fine, but with dxvk Unity panels stay visible and mouse input offsetted by size of panels. So not playeble. Virtual desktop dont helps.

offtop:
i pressed alt+enter in BFBC2 and window dissapear (but process stay alive). and now when i start it - window not visible anymore. restart and renaiming exe dont helps. other wine games works well. this combination dont do anything in other windows... WTF? maybe someone knows...

@doitsujin
Copy link
Owner

doitsujin commented Jul 16, 2018

I would need some help by someone who knows their way around low-level WIn32 window management to fix this. For now I'm treating this as a DXVK bug since people are reporting many input-related issues lately that don't seem to happen with wined3d.

There's literally nothing I can do about it since I lack the knowledge.

@Guy1524
Copy link
Contributor

Guy1524 commented Jul 17, 2018

Maybe switch back to SDL ;-)

@xpander69
Copy link
Contributor

does this happen when your screens have different resolutions? just a random thought as i have both 2560x1440, maybe thatswhy i haven't seen this issue.

also is there some free or super cheap game that has that issue so i can try if i have it also

@Cloudef
Copy link

Cloudef commented Aug 11, 2018

https://www.uninformativ.de/git/xpointerbarrier/file/README.html you guys may want to use this program on problematic games + multi-monitor combo. It makes sure the cursor stays in single monitor. The techniques wine uses to prevent this is not good enough, because it's poll based, pointer barriers reside in X server thus making sure pointer never escapes the monitor.

@maximt
Copy link

maximt commented Aug 13, 2018

@Cloudef, thanks, the cursor is locked in area, but it's useless for FPS games, mouse lookaround dont work, it's stuck on window's border.

@byaka
Copy link

byaka commented Aug 13, 2018

@Cloudef , @maximt looks like it's similar method, thats use POL - when "force lock" enabled i have same problem in some games (wine's mouse-lock in this games work different and usually better)

@Kiwii
Copy link

Kiwii commented Sep 5, 2018

I'd recommend anyone having strange mouse issues to retest with wine-staging 3.15 as it seems to have a fix for it.
ValveSoftware/Proton#147 (comment)

@jan-lugfl
Copy link

Short feedback on this specifically for Fallout4:

Wine-staging 3.18 on Gentoo
Happens with DXVK-0.91 but not wined3d.
Happens regardless if game res. == desktop res. or not.

  • Ensuring bBackgroundMouse=0 in Fallout4.ini fixes/mitigates the issue using DXVK for me.

@byaka
Copy link

byaka commented Nov 11, 2018

@jan-lugfl good to know, thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests