Dota-2 icon indicating copy to clipboard operation
Dota-2 copied to clipboard

[Linux] Game not capturing mouse on multi-monitor setup

Open eeceebee opened this issue 1 year ago • 13 comments

Your system information

  • System information from steam
  • Have you checked for system updates?: Yes
  • Are you using the latest stable video driver available for your system? Yes
  • Have you verified the game files?: Yes

Please describe your issue in as much detail as possible:

On a multi-monitor setup (Wayland, Mesa, Gnome, OpenSUSE tumbleweed) the mouse is not being captured by the game window when using "Desktop-Friendly Fullscreen".

The mouse is free to move from the primary monitor (using DisplayPort) onto the second monitor (using HDMI).

What should happen is: the mouse should be free to leave the game window while on the menu, but then be captured by the game window (and not allowed to leave) once a game has started.

Additionally: The mouse IS being captured when using "Borderless Window" however the game will only launch on the second monitor and cannot be moved to the correct (main) monitor. Changing "-sdl_displayindex" or adding "-phased_window_create" has no effect.

I've seen a few semi-related issues from the past, but they generally are the reverse: Borderless Window doesn't capture the mouse. The proposed solutions are generally to try adding -phased_window_create to launch options.

Steps for reproducing this issue:

  1. Launch Dota 2
  2. Create a custom lobby (or join a game)
  3. Move cursor out of the game window and onto the second monitor.

eeceebee avatar May 20 '24 16:05 eeceebee

Same issue on Arch Linux with two monitors. I have to disable and turn off the secondary monitor or the mouse is unplayable.

Steam sysinfo - https://gist.github.com/Strykar/12b6dfdd413b9708e728fba8c199be0d

Strykar avatar May 21 '24 08:05 Strykar

I'm having similar issues to @Strykar . Mouse is "locked" to the left half of the screen when in-game, seems to be that the mouse region is not positioned correctly in relation to where the game window actually is. Borderless/exclusive does not seem to matter.

ivakam avatar May 23 '24 20:05 ivakam

im with the same problem :(

gomes1876 avatar Jun 03 '24 15:06 gomes1876

Same as @ivakam , since updating to Ubuntu 24.04 from 23.10. Three monitor setup (1080p, 1440p, 1080p) with the game on the middle one. Once I click in the left, say, 25% of the game, the cursor gets stuck there. Unfocusing the window or moving it onto another monitor fixes it until I click there again. Tried running the game at different resolutions, on other monitors, and with different window options, to no avail.

geez0x1 avatar Jun 07 '24 17:06 geez0x1

Echoing what @ivakam & @geez0x1 are seeing. My second monitor is positioned to the left of my primary monitor. If I were to take a guess, @ivakam is right on the money with their assessment. The region that the mouse gets "locked" to on my primary monitor is roughly 1/4 of the screen which would would track as 2560 - 1920 = 640 (the horizontal difference in resolution on my monitors). I suspect the size of the mouse capture zone is correct, but it's starting from the left-most monitor instead of the monitor the game is display on.

Also, I am seeing this in most games run via Steam when in fullscreen mode. So it's not exclusive to Dota 2.

Might be related to:

  • https://github.com/ValveSoftware/Proton/issues/7564

My setup: Ubuntu 24.04 Gnome (Wayland) Nvidia drivers: 555.52.04

Dannflower avatar Jun 17 '24 03:06 Dannflower

If anyone is seeing this, I use %command% -sdl_displayindex 1 dota_mouse_window_lock 1 as launch parameters on steam to allow me to play on multi monitor setup Ubuntu 24.04 (PopOs) with wayland

The mouse will be able to quit the screen out of a match, but when in an actual match, it will fit the monitor it is running on.

Kwaadpepper avatar Jun 21 '24 16:06 Kwaadpepper

Small update on this:

I was still having issues with this, however as a workaround moving my secondary monitor to the right of the primary monitor fixes the issue.

This seems to specifically be related to secondary monitors located to the left of the primary monitor.

eeceebee avatar Jun 24 '24 13:06 eeceebee

@Kwaadpepper's solution doesn't work on my setup, which is quite possibly of what @eeceebee described; my left-most monitor is 1080p while the middle one is 1440p. (yes I tried changing the index). When on the left-most screen, the mouse actually gets stuck at the bottom (which is even more odd - no screen has smaller than 1080p vertical resolution)

geez0x1 avatar Jun 28 '24 18:06 geez0x1

Since I've been seeing this bug in quite a few games, I've opened a separate issue on the Proton side as well as it's unclear to me if it's a Wayland, Wine, or Proton quirk.

  • https://github.com/ValveSoftware/Proton/issues/7902

Dannflower avatar Jul 15 '24 03:07 Dannflower

Since I've been seeing this bug in quite a few games, I've opened a separate issue on the Proton side as well as it's unclear to me if it's a Wayland, Wine, or Proton quirk.

* [Incorrect mouse capture area with fullscreen games when secondary monitor is left of the primary monitor Proton#7902](https://github.com/ValveSoftware/Proton/issues/7902)

You cant play dota under proton, it doesnt let you queue for games, so I doubt its a proton issue.

SQalliT avatar Aug 01 '24 20:08 SQalliT

You cant play dota under proton, it doesnt let you queue for games, so I doubt its a proton issue.

Ah, bad assumption on my part when I opened that issue. Thanks for pointing it out. For what it's worth, I ended up switching over to Fedora 40 and this issue is not present.

Dannflower avatar Aug 02 '24 01:08 Dannflower

I experienced the same issue under gentoo + kde plasma 6 + wayland + nvidia. Issue was not present under debian.

I changed my screen scaling in Display Configuration and changed my display scaling from 115% to 100%. That fixed it.

scottzoloft avatar May 07 '25 02:05 scottzoloft

This is currently an issue for me. Switching to windowed mode from bordless fullscreen as a workaround seems to have worked for me.

tmzhuang avatar Oct 08 '25 02:10 tmzhuang