-
Notifications
You must be signed in to change notification settings - Fork 68
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
[Linux] CS:GO sometimes launches on the wrong monitor #60
Comments
would really like tips on fixing this too |
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. |
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. |
Not sure if this is the cause but see what monitor is primary in both Xorg and in VM. |
It is already the case. |
CS:GO opens up on my primary monitor as expected. Also, are you all using the same resolution on both monitors? |
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 |
I have similar problem: My 2nd monitor is set as primary in linux system but CS start fullscreen on 1st one. 2 monitors setup
|
same problem here. |
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. |
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. |
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. |
@devhen @gulafaran : You can simply hit the "Super" key and drag the csgo window on the right monitor :) |
so funny, no matter what sdl env var i change nor xorg conf, the game will ALWAYS open on the non primary one. |
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. |
@mariodonofrio changing "sdl_displayindex" variable value fix'ed this issue for me |
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. |
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. |
Confirmed that changing the config.cfg sdl_displayindex solved this issue for me. |
Any push to get this fixed? Is it backlogged? |
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, your config.cfg should be located at 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. |
Dota 2 does launch in the secondary monitor for me. Any idea how to fix it? |
+1 Would love to see this fixed! |
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. |
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. |
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. Setup:CSGO buildID: 1831910 |
The resolution mismatch is being tracked at #1322. |
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 . |
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. |
I am continuing to have the issue, the sdl_displayindex workaround of course works but generally gets reset every time the game is launched with no success so far to change this through normal means. I have found that using "sudo chatter +i config.cfg" will not allow one to reset it (for those unaware, this applies the immutable tag to the file, making it impossible to change for even the superuser, unless the tag is first removed with chattr -i config.cfg). I believe this will also not allow you to change any csgo settings however so it is not ideal. Currently my biggest problem however remains to be #1322 |
Happens to me too after the update from Ubuntu 16.04 to 18.04 |
Well. I had some trouble with Devil Daggers not starting and tried a |
For some reason my config.cfg had "sdl_displayindex 1" set. I have 3x1920x1080 monitors, and this resulted in the game launching on my left monitor, yet my middle one is set as Primary/Default in my environment. Setting it to "0" in the in-game console (then gracefully quitting) "resolved" this, however I think having in-game settings support for this facet really is the best long-term way to do this. Since this issue really isn't self-evident of the cause. |
Welp, it's still here! 6yrs and counting 🤦♂️ |
The same happens on Pop!_OS 20.04 |
Ubuntu two monitor setup and fullscreen modus: Game always starts on secondary monitor Issue transferred from #2542. Your system information
Please describe your issue in as much detail as possible:I have two monitors. One with 1920x1080 resolution (primary) and an old 4:3 monitor (secondary) on the left side on my desk. Also as a side note: If I start the game I get for a couple for seconds a black screen and a "csgo_linux64 not responding" warning before the CS:GO starting screen appears. All in all the game needs 15-20 seconds to start up. Steps for reproducing this issue:
@kisak-valve commented on 2020-10-23T12:47:44: Hello @ptck, this issue is already being tracked at #60 with a possible workaround at #60 (comment). Also, your side note is being tracked at #665. Closing as a duplicate. @ptck commented on 2020-10-23T14:25:47: @kisak-valve Thanks for #60. Unfortunately none of the suggestions there helped. @kisak-valve commented on 2020-10-23T14:30:29: Just to check, did you remove the |
I have the exact same issue. My monitors are enumerated exactly like this in the Ubuntu display settings (1 and 2) and I have the same resolutions for both monitors. My secondary monitor is also positioned left of my primary monitor. The only difference is that I have Ubuntu 20.04 and my primary monitor is connected via DVI, not HDMI. To expand on this: sdl_displayindex is always resetted to 1. I did not set any launch options.
Also this is the same for me. But I don't have a long startup time (15-20 seconds). |
Another workaround for X11: wpid=$(xprop -id `xdotool getwindowfocus` | grep '_NET_WM_PID' | grep -oE '[[:digit:]]*$')
win=$(xdotool search --pid $wpid | head -n1)
wmctrl -i -r $win -e 0,1920,0,-1,-1 Put this into a script, bind it to a keyboard shortcut or add it to EDIT: Oh, works only until the game is minimized, then it jumps back to the left-most monitor. |
I had success using gamescope. |
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
The text was updated successfully, but these errors were encountered: