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

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

Open
Semperverus opened this issue May 15, 2020 · 18 comments

Comments

@Semperverus
Copy link

Semperverus commented May 15, 2020

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
Copy link
Author

Semperverus commented May 15, 2020

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
Copy link
Author

Semperverus commented May 15, 2020

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
Copy link
Author

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

@Semperverus Semperverus changed the title Mouse is captured in windowed-fullscreen game in multimonitor configuration Mouse is captured in windowed-fullscreen game in multimonitor configuration when it should not be. May 15, 2020
@aeikum
Copy link
Collaborator

aeikum commented May 18, 2020

Hey there. This was actually enabled by user request, see #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@8a0f4ad. 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
Copy link

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
Copy link

bailtree commented Oct 2, 2020

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
Copy link

ModProg commented Dec 19, 2020

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
Copy link

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
Copy link

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

@Dubbeldrank
Copy link

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
Copy link

ghost commented Mar 18, 2021

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
Copy link

ItsRogueRen commented May 21, 2021

Replying to #3871 (comment)

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
Copy link

ghost commented Jul 2, 2021

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
Copy link

lyghtnox commented Jul 20, 2021

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
Copy link

emersonrp commented Aug 6, 2021

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
Copy link

mercster commented Aug 6, 2021

@emersonrp Yes exactly.

@georgehank
Copy link

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
Copy link

Milliw commented May 18, 2023

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! =)

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

No branches or pull requests