[Linux] CS:GO sometimes launches on the wrong monitor #60

Open
Locat opened this Issue Sep 23, 2014 · 31 comments

Comments

Projects
None yet

Locat commented Sep 23, 2014

I have 2 monitors. My main monitor is correctly configured and when launching Dota 2, I have no problem with this whatsoever. So it seems like a CS:GO related problem. When rebooting the problem goes away but after playing for a bit quitting the game and launching it back it reappears.

https://gist.github.com/Locat/17842717e965193629f6

This comment has been minimized.

Show comment Hide comment
@Thermionix

Thermionix Sep 23, 2014

would really like tips on fixing this too

would really like tips on fixing this too

This comment has been minimized.

Show comment Hide comment
@speedfreak01

speedfreak01 Sep 24, 2014

I had the same issue as well. To get the game on the correct screen i just disabled the other monitor temporarily whilst i played.

Im not sure if this is specifically related to CS:GO though, given i have had the same issues with some other steam games.
Would be cool if the steam client allowed you to specify which screen you want a game to run on.

I had the same issue as well. To get the game on the correct screen i just disabled the other monitor temporarily whilst i played.

Im not sure if this is specifically related to CS:GO though, given i have had the same issues with some other steam games.
Would be cool if the steam client allowed you to specify which screen you want a game to run on.

This comment has been minimized.

Show comment Hide comment
@Locat

Locat Sep 24, 2014

Yeah might be dependant on games. Dota 2 works fine though. It's a really frustrating bug, the worst is that sometimes it works and sometimes not and I have not a single clue as to why.

Edit: The only way I found of fixing it atm is going into either fullscreen windowed or windowed mode, dragging the window the right monitor and then going back to fullscreen.

Locat commented Sep 24, 2014

Yeah might be dependant on games. Dota 2 works fine though. It's a really frustrating bug, the worst is that sometimes it works and sometimes not and I have not a single clue as to why.

Edit: The only way I found of fixing it atm is going into either fullscreen windowed or windowed mode, dragging the window the right monitor and then going back to fullscreen.

This comment has been minimized.

Show comment Hide comment
@CommanderAlchemy

CommanderAlchemy Sep 24, 2014

Not sure if this is the cause but see what monitor is primary in both Xorg and in VM.

Not sure if this is the cause but see what monitor is primary in both Xorg and in VM.

This comment has been minimized.

Show comment Hide comment
@Locat

Locat Sep 25, 2014

It is already the case.

Locat commented Sep 25, 2014

It is already the case.

This comment has been minimized.

Show comment Hide comment
@qshane

qshane Sep 25, 2014

CS:GO opens up on my primary monitor as expected.

Also, are you all using the same resolution on both monitors?

qshane commented Sep 25, 2014

CS:GO opens up on my primary monitor as expected.

Also, are you all using the same resolution on both monitors?

This comment has been minimized.

Show comment Hide comment
@Locat

Locat Sep 26, 2014

One is a 5:4 monitor and one a 16:9 so not the same resolution. As I said it is strange because it works at first and then it stops working, even when the focus is on the right monitor

Locat commented Sep 26, 2014

One is a 5:4 monitor and one a 16:9 so not the same resolution. As I said it is strange because it works at first and then it stops working, even when the focus is on the right monitor

This comment has been minimized.

Show comment Hide comment
@audkar

audkar Sep 26, 2014

I have similar problem: My 2nd monitor is set as primary in linux system but CS start fullscreen on 1st one.

2 monitors setup

  • monitor1 (left side), monitor2 (right side) [primary]. With this configuration CS start on first one.
  • If it change their order to monitor2 (left side), monitor1(right side (1024)), then CS start on my monitor2...

audkar commented Sep 26, 2014

I have similar problem: My 2nd monitor is set as primary in linux system but CS start fullscreen on 1st one.

2 monitors setup

  • monitor1 (left side), monitor2 (right side) [primary]. With this configuration CS start on first one.
  • If it change their order to monitor2 (left side), monitor1(right side (1024)), then CS start on my monitor2...

This comment has been minimized.

Show comment Hide comment
@Slydder

Slydder Sep 28, 2014

same problem here.

Slydder commented Sep 28, 2014

same problem here.

This comment has been minimized.

Show comment Hide comment
@devhen

devhen Jan 14, 2015

Same. It usually opens on my primary display but sometimes opens on the secondary. I was hoping there might be a way to force which monitor it uses.

devhen commented Jan 14, 2015

Same. It usually opens on my primary display but sometimes opens on the secondary. I was hoping there might be a way to force which monitor it uses.

This comment has been minimized.

Show comment Hide comment
@devhen

devhen Jan 22, 2015

FYI, I've been able to get around it by disabling my secondary monitor in GNOME3, start the game, then alt-tab out and re-enable the secondary monitor.

devhen commented Jan 22, 2015

FYI, I've been able to get around it by disabling my secondary monitor in GNOME3, start the game, then alt-tab out and re-enable the secondary monitor.

This comment has been minimized.

Show comment Hide comment
@gulafaran

gulafaran Jan 26, 2015

same problem here too. however i just set the second monitor as "primary" and it opens on the right one but that means i need to change it back when im opening any other game.

same problem here too. however i just set the second monitor as "primary" and it opens on the right one but that means i need to change it back when im opening any other game.

This comment has been minimized.

Show comment Hide comment
@jocelynthode

jocelynthode Jan 26, 2015

@devhen @gulafaran : You can simply hit the "Super" key and drag the csgo window on the right monitor :)

@devhen @gulafaran : You can simply hit the "Super" key and drag the csgo window on the right monitor :)

This comment has been minimized.

Show comment Hide comment
@gulafaran

gulafaran Jan 31, 2015

so funny, no matter what sdl env var i change nor xorg conf, the game will ALWAYS open on the non primary one.

so funny, no matter what sdl env var i change nor xorg conf, the game will ALWAYS open on the non primary one.

This comment has been minimized.

Show comment Hide comment
@mariodonofrio

mariodonofrio Feb 2, 2015

Can you let me know what "sdl_displayindex" is set to in your config.cfg (in the game/csgo/cfg folder). This is not a public convar, but the value is written to/read from this file, and if changing it (if you have two monitors, the range of values is just 0 and 1) makes any difference to how the game boots up - the multi-monitor startup configuration should be handled the same way as Dota2.
Thanks.

Can you let me know what "sdl_displayindex" is set to in your config.cfg (in the game/csgo/cfg folder). This is not a public convar, but the value is written to/read from this file, and if changing it (if you have two monitors, the range of values is just 0 and 1) makes any difference to how the game boots up - the multi-monitor startup configuration should be handled the same way as Dota2.
Thanks.

This comment has been minimized.

Show comment Hide comment
@audkar

audkar Feb 2, 2015

@mariodonofrio changing "sdl_displayindex" variable value fix'ed this issue for me

audkar commented Feb 2, 2015

@mariodonofrio changing "sdl_displayindex" variable value fix'ed this issue for me

This comment has been minimized.

Show comment Hide comment
@mariodonofrio

mariodonofrio Feb 2, 2015

Thanks @audkar - sdl_displayindex should get written with whichever monitor you last played CS:GO on (i.e. if you move it to another monitor it will change). There are some issues with SDL not enumerating the displays correctly on all boxes, but if you moved it to a display it should put it back up on that same display regardless of enumeration. It might be worth trying to do that, and enforcing the change by modifying the video settings (change resolution, go full-screen or windowed, etc) and saving them - this should force the sdl_displayindex update in that config file.

Be interested in hearing what other users that have had issues might experience too.

Thanks @audkar - sdl_displayindex should get written with whichever monitor you last played CS:GO on (i.e. if you move it to another monitor it will change). There are some issues with SDL not enumerating the displays correctly on all boxes, but if you moved it to a display it should put it back up on that same display regardless of enumeration. It might be worth trying to do that, and enforcing the change by modifying the video settings (change resolution, go full-screen or windowed, etc) and saving them - this should force the sdl_displayindex update in that config file.

Be interested in hearing what other users that have had issues might experience too.

This comment has been minimized.

Show comment Hide comment
@gulafaran

gulafaran Feb 16, 2015

yeah changing displayindex to 1 , makes it open on my middle monitor. i run three and the mid one is set as primary and most things works with this even something as basic as https://wiki.libsdl.org/SDL_GetCurrentDisplayMode orders it correctly, however steam and its games seems to open the games on the most left one at all times.

yeah changing displayindex to 1 , makes it open on my middle monitor. i run three and the mid one is set as primary and most things works with this even something as basic as https://wiki.libsdl.org/SDL_GetCurrentDisplayMode orders it correctly, however steam and its games seems to open the games on the most left one at all times.

This comment has been minimized.

Show comment Hide comment
@bsuttonq

bsuttonq Feb 17, 2015

Confirmed that changing the config.cfg sdl_displayindex solved this issue for me.

Confirmed that changing the config.cfg sdl_displayindex solved this issue for me.

This comment has been minimized.

Show comment Hide comment
@bm956

bm956 Dec 16, 2015

Any push to get this fixed? Is it backlogged?

bm956 commented Dec 16, 2015

Any push to get this fixed? Is it backlogged?

This comment has been minimized.

Show comment Hide comment
@Dotile

Dotile Apr 23, 2016

I have no config.cfg file in my folder only to other files named config containing the keyboard and 360 controller configuration.

Can I create my own config.cfg file and add sdl_displayindex?

Dotile commented Apr 23, 2016

I have no config.cfg file in my folder only to other files named config containing the keyboard and 360 controller configuration.

Can I create my own config.cfg file and add sdl_displayindex?

This comment has been minimized.

Show comment Hide comment
@Tele42

Tele42 Jun 24, 2016

Contributor

@Dotile, your config.cfg should be located at ~/.local/share/Steam/userdata/<steamid>/730/local/cfg/config.cfg or similar, depending on where your distro put the steam folder.

Note for dev: I suspect all affected users have a primary monitor to the right, sdl_displayindex 0 is the primary monitor, and CS:GO is not enumerating the monitors in the correct order. The physical connections going to the displays are most likely not enumerated from the leftmost to the rightmost.

Contributor

Tele42 commented Jun 24, 2016

@Dotile, your config.cfg should be located at ~/.local/share/Steam/userdata/<steamid>/730/local/cfg/config.cfg or similar, depending on where your distro put the steam folder.

Note for dev: I suspect all affected users have a primary monitor to the right, sdl_displayindex 0 is the primary monitor, and CS:GO is not enumerating the monitors in the correct order. The physical connections going to the displays are most likely not enumerated from the leftmost to the rightmost.

@Tele42 Tele42 added the Linux label Jun 24, 2016

This comment has been minimized.

Show comment Hide comment
@Mercotui

Mercotui Aug 31, 2016

still an issue, combined with #608 #4566 and #528 for me

still an issue, combined with #608 #4566 and #528 for me

This comment has been minimized.

Show comment Hide comment
@AntouanK

AntouanK Feb 4, 2017

Dota 2 does launch in the secondary monitor for me.
I do use xrandr to set the primary monitor, and tried nvidia-setting as well. Still it keeps launching in the secondary one.
Big picture mode does the same.

Any idea how to fix it?

AntouanK commented Feb 4, 2017

Dota 2 does launch in the secondary monitor for me.
I do use xrandr to set the primary monitor, and tried nvidia-setting as well. Still it keeps launching in the secondary one.
Big picture mode does the same.

Any idea how to fix it?

This comment has been minimized.

Show comment Hide comment
@birgersp

birgersp Mar 8, 2017

+1

Would love to see this fixed!

birgersp commented Mar 8, 2017

+1

Would love to see this fixed!

This comment has been minimized.

Show comment Hide comment
@kaskii

kaskii May 10, 2017

Had same problem on Linux Mint (18.1, dual monitor, nvidia-375) with CS:GO after alt+tabbing out of the game. I fixed it by changing to windowed mode, dragging window to correct display and changing full screen mode back. Haven't tested changing sdl_displayindex as now the game opens on correct display every time.

kaskii commented May 10, 2017

Had same problem on Linux Mint (18.1, dual monitor, nvidia-375) with CS:GO after alt+tabbing out of the game. I fixed it by changing to windowed mode, dragging window to correct display and changing full screen mode back. Haven't tested changing sdl_displayindex as now the game opens on correct display every time.

This comment has been minimized.

Show comment Hide comment
@kisak-valve

kisak-valve May 23, 2017

Owner

For everyone currently affected, please switch the game to windowed, dragging it to the preferred monitor, then switching it back to the previous display mode (fullscreen or fullscreen windowed) and close CS:GO to make sure the setting is saved.

If this does not resolve the issue, please describe your monitor layout with emphasis on the primary monitor and the order the monitors are enumerated. Also include your distro version.

Owner

kisak-valve commented May 23, 2017

For everyone currently affected, please switch the game to windowed, dragging it to the preferred monitor, then switching it back to the previous display mode (fullscreen or fullscreen windowed) and close CS:GO to make sure the setting is saved.

If this does not resolve the issue, please describe your monitor layout with emphasis on the primary monitor and the order the monitors are enumerated. Also include your distro version.

This comment has been minimized.

Show comment Hide comment
@Mercotui

Mercotui May 23, 2017

screenshot from 2017-05-23 17-33-00
I tried the method described by @kisak-valve , but with minimal succes.

Expected behavior:

Game starts on the primary monitor, with the correct primary monitors resolution.

Actual behavior:

The game now starts on my primary monitor, but in the secondary resolution, leaving undrawn areas of the window. See picture, The chrome browser running on the secondary monitor, and the game running on the primary monitor, with incorrect resolution.
Note that if I forcibly move the game away and back to the primary monitor, the resolution adapts correctly.

Setup:

CSGO buildID: 1831910
Distro: Fedora 24
Monitor enumerated as 1: VGA display, labeled secondary monitor in gnomeshell resolution 1280x1024
Monitor enumerated as 2: HDMI display, labeled primary monitor in gnomeshell; resolution 1920x1080
Monitor 1 (secondary monitor), is positioned left of Monitor 2 (primary monitor).

Mercotui commented May 23, 2017

screenshot from 2017-05-23 17-33-00
I tried the method described by @kisak-valve , but with minimal succes.

Expected behavior:

Game starts on the primary monitor, with the correct primary monitors resolution.

Actual behavior:

The game now starts on my primary monitor, but in the secondary resolution, leaving undrawn areas of the window. See picture, The chrome browser running on the secondary monitor, and the game running on the primary monitor, with incorrect resolution.
Note that if I forcibly move the game away and back to the primary monitor, the resolution adapts correctly.

Setup:

CSGO buildID: 1831910
Distro: Fedora 24
Monitor enumerated as 1: VGA display, labeled secondary monitor in gnomeshell resolution 1280x1024
Monitor enumerated as 2: HDMI display, labeled primary monitor in gnomeshell; resolution 1920x1080
Monitor 1 (secondary monitor), is positioned left of Monitor 2 (primary monitor).

This comment has been minimized.

Show comment Hide comment
@kisak-valve

kisak-valve May 23, 2017

Owner

The resolution mismatch is being tracked at #1322.

Owner

kisak-valve commented May 23, 2017

The resolution mismatch is being tracked at #1322.

This comment has been minimized.

Show comment Hide comment
@Mercotui

Mercotui May 23, 2017

actually, testing it more (testing is very slow because of #608 ) it seems the following happens:

I set the correct monitor by the method described by @kisak-valve .
First time starting the game afterwards: it launches on the primary monitor, but in the secondary's resolution.
Any additional attempt afterwards: the games launches in the secondary monitor, in the secondary's resolution.

actually, testing it more (testing is very slow because of #608 ) it seems the following happens:

I set the correct monitor by the method described by @kisak-valve .
First time starting the game afterwards: it launches on the primary monitor, but in the secondary's resolution.
Any additional attempt afterwards: the games launches in the secondary monitor, in the secondary's resolution.

This comment has been minimized.

Show comment Hide comment
@kisak-valve

kisak-valve Jul 20, 2017

Owner

Sdl_displayindex is getting reset to 0 if the game is minimized / alt-tabbed at any point. While the window is restored to the correct monitor, this change is commited to the config when the game is closed and then launches on the wrong monitor on the next start of the game.

Owner

kisak-valve commented Jul 20, 2017

Sdl_displayindex is getting reset to 0 if the game is minimized / alt-tabbed at any point. While the window is restored to the correct monitor, this change is commited to the config when the game is closed and then launches on the wrong monitor on the next start of the game.

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