ValveSoftware / Proton

Compatibility tool for Steam Play based on Wine and additional components
Other
24.33k stars 1.06k forks source link

Mouse is captured in windowed-fullscreen game in multimonitor configuration when it should not be. #3871

Open Semperverus opened 4 years ago

Semperverus commented 4 years ago

This happens and was tested in all currently available versions of Proton.

In all games, under WINE and in Windows, so long as the game gives you a cursor, you are able to drag the cursor out of the game window and onto another monitor or your desktop.

Under Proton however, this is not the case. The mouse is trapped in the game window, despite being windowed fullscreen (or "borderless fullscreen" in some games). The mouse should be able to move freely away from the game if the game presents a cursor (such as entering a menu in Warframe or Skyrim) as it does on Windows and in WINE. The only way to currently do this is to Alt+Tab onto another program and then move your mouse out of the game window.

Semperverus commented 4 years ago

It turns out that this is caused by the fact that, for some reason, Proton has opted to enable "Capture mouse in fullscreen applications" by default, which should not be the case.

I had to perform the following to get winecfg to load into the correct prefix:

PROTON_VERSION=5.0
PROTON_DIR=~/.local/share/Steam/steamapps/common
GAMEPFX_DIR=~/.steam/steam/steamapps/compatdata/{REPLACE ME WITH GAME ID}/pfx/
export WINEPREFIX="$GAMEPFX_DIR" WINEARCH=win64
"$PROTON_DIR/Proton $PROTON_VERSION/dist/bin/wine64" 'winecfg.exe'

As a bash script, or entering the lines one by one in a shell works.

Once I did that, I was able to actually modify the settings for the games I was trying to edit. Disabling "Capture Mouse in Fullscreen Applications" resolved the issue.

This setting should be changed to "Off" or "False" by default.

Semperverus commented 4 years ago

image

As shown in this window here, this option being disabled will return behavior of applications back to "as expected". (This menu also successfully let me set my proper DPI for games that read this value, which I hadn't been able to do until now)

Semperverus commented 4 years ago

If someone can tell me where the default value is stored, I will make a pull request to change this.

aeikum commented 4 years ago

Hey there. This was actually enabled by user request, see https://github.com/ValveSoftware/Proton/issues/53 . I'm not sure what the impact of turning it off would be. FPS games for example really do need to capture the mouse. Perhaps our mouse capture code has improved enough that we could turn this off again and depend on the game capturing the mouse correctly.

This was enabled in ValveSoftware/wine@8a0f4add2096d213999d9be7a04229d288f1af75. I don't think I'd accept a PR to revert that without understanding the impact. Unfortunately the users on issue #53 didn't mention the games they were having problems with, so it's hard for us to retest...

mercster commented 4 years ago

Yes please make a GUI way to change this behavior across all Proton-installed games. Whoever suggested this (and was given this change) was obviously a goober. I realize for some games it is necessary (kinda?) but for others, it is disastrous. This needs to be an option.

bailtree commented 4 years ago

I also have 2 monitors, and run games in windowed-fullscreen, but with this option in winecfg ticked means that I have to alt-tab or otherwise unfocus the game to move the cursor to my other monitor :(

ModProg commented 3 years ago

Maybe there could just be a game option for proton either the steam game settings, but I would also be fine with a command line option

MurdoMaclachlan commented 3 years ago

Some kind of option to toggle this setting would be greatly appreciated. Like others, I have 2 monitors but often have to alt+tab in order to unfocus the game.

mercster commented 3 years ago

Heh, I think we're fighting a losing battle here, but I agree; a command line option would be great.

Dubbeldrank commented 3 years ago

I'm running into the same problem with EVE Online, fullscreen windowed mode shouldn't capture the mouse whereas fullscreen should. Please make this an option, command line is fine with me!

ghost commented 3 years ago

I did WINEPREFIX=~/.steam/steam/steamapps/compatdata/212500/pfx/ winecfg earlier and "Automatically capture the mouse in fullscreen windows" was already unchecked, which had led me to believe that this wasn't the issue. But the commands from the second post in this issue worked better, I was able to uncheck it for that game and now everything is fine.

I agree that having it on by default is probably the right choice for most games, but I think at least for whitelisted games, it should be set on a per-game basis. For everything else, there's no real need for it to be off by default.

Linux version of the Steam client should just have a right-click option under Manage for each game, that would automatically open winecfg on that game's prefix using the version of Proton that's currently in use by that game, to allow for easy access to tweaking settings when needed.

That way it'll be on by default, so most games won't really require additional tweaking, and for the few games where you want to still be able to move the mouse cursor outside of the game window when in windowed fullscreen, you could just access the winecfg for that game and uncheck the option.

ItsRogueRen commented 3 years ago

Replying to https://github.com/ValveSoftware/Proton/issues/3871#issuecomment-802108062

I don't have the location in the commands /home/user/.local/share/Steam and everything past that. I just have a normal .deb install of Steam so idk why its not there, but there is no Steam folder in .local at all.

ghost commented 3 years ago

Ahh whoops, missed this sorry

You have to adapt this to whatever your folder structure is. The other person probably changed the path for steam game installs is all.

I just do this (one line!), replacing user, gameID and version with your user name, game's ID that you wish to configure, and Proton version you're using.

WINEPREFIX=/home/[...user...]/.steam/debian-installation/steamapps/compatdata/[...gameID...]/pfx WINEARCH=win64 "/home/[...user...]/.steam/debian-installation/steamapps/common/Proton [...version...]/dist/bin/wine64" winecfg

but even then, the exact path to your steamapps common/compatdata folders may vary. By default they should be in .steam though.

lyghtnox commented 3 years ago

Since I haven't seen anyone mentioning it :

You can use protontricks to easily configure wine for a specific game.

protontricks -s game_name
protontricks game_id winecfg

First command will give you the game id and the second one will open the winecfg used for this game. From here you can uncheck the box "Automatically capture the mouse in full-screen windows". You can do other things with the tool, check the doc. Hope this helps someone.

emersonrp commented 3 years ago

The workaround works for me, but is still sort of a hack.

In Windows itself, basically every app does the right thing wrt being borderless-windowed. In FPS games, where yes you want not to have the cursor change focus while you're running and gunning, basically 100% of them capture the mouse when the cursor is invisible, ie, most of the time, but then release it when the cursor reappears, ie after hitting ESC to bring up the menu or map or other cursor-needing UI.

That is to say, cursor capture in borderless windowed games in Windows seems to be directly tied to cursor -visibility-.

This also affects the experience in single-monitor modes: in Windows, if you alt-tab to another window, it raises above your borderless windowed game and stays there until you click on the game to re-focus/raise it. In Proton, if I have my browser above the game and (possibly accidentally) move the mouse over the game, it captures/raises the game without clicking.

mercster commented 3 years ago

@emersonrp Yes exactly.

georgehank commented 2 years ago

I came here googling for a way to make a game capture the mouse even in windowed borderless (on Windows though)… an option would be sweet, but I absolutely can and want to live with the default (of having to alt-tab out to go somewhere else… though the best would be a per-game option; with some games it's great to just move the mouse of the window, with others it's the end of (game) world to accidentally(!) click outside the game window.)

Milliw commented 1 year ago

I came here for research.

I do have the opposite problem. On my main game Hunt: Showdown the mouse escapes often to second monitor on accident leading to some heave issues depending on the situation. I ran protontricks winecfg and set that option to force capture the mouse but it does not apply. :-/

Thx @lyghtnox for that handy hint btw! =)

NickDeBeenSAE commented 2 months ago

Replying to https://github.com/ValveSoftware/Proton/issues/3871#issuecomment-629096666

I never get "Automatically capture the mouse when in full-screen windows" when I run protontricks --gui

I get the other 3 though.