ValveSoftware / csgo-osx-linux

Counter-Strike: Global Offensive
http://counter-strike.net
787 stars 69 forks source link

[Linux] Leftmost aspect ratio used when restoring fullscreen window #1322

Open oddko opened 7 years ago

oddko commented 7 years ago

Hello,

Weird Issue on a 21:9 (2560*1080) display, when using that resolution in fullscreen, it works fine after launch, but if I alt tab and come back, it seems to be displaying the image in a 16:9 ratio and still at the same resolution (hence why it looks distorded, see the image below which is a raw printscreen). http://imgur.com/a/7bgSw This issue defo isnt GPU vendor related as I had it on my previous AMD card and still have it on my new NVIDIA card.

oddko commented 7 years ago

Hello,

Reinstalling the game doesnt help, but I did further testing and nailed the issue a bit more. First, it only seems to happen when using multiple monitors. As you saw from my screenshot, I am using a standard 16:9 1080p display as my secondary monitor. If I unplug it and only use my 21:9 display, this issue does not happen. But then I tried pluging the 21:9 panel into my razer blade stealth (1440p screen laptop, intel HD graphics) and use 21:9 fullscreen once again, and this time when alt tabbing, it will try to display the 25601080 image as a 25601440 image ! hence stretching the game vertically this time, and cutting out of the display the upper part of the image. So yeah there you have it, check multi-display users.

2017-02-22 1:40 GMT+01:00 ranjeet-valve notifications@github.com:

Hello piunky could you reinstall the game to test? There may be some Windows configs that got placed on your system

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ValveSoftware/csgo-osx-linux/issues/1322#issuecomment-281530180, or mute the thread https://github.com/notifications/unsubscribe-auth/AOgqyXYRZjYEve2jZ6JTsWSaEr_bFoGsks5re4P2gaJpZM4MB-eD .

kisak-valve commented 7 years ago

Posted by @yami-kage on #1362 (original at https://github.com/ValveSoftware/steam-for-linux/issues/4911):

Please describe your issue in as much detail as possible:

Since I changed my left and right monitors to be rotated counter clockwise (tall) I have been having a problem with CS:GO. The game is running on my primary (middle) monitor at normal rotation. All three monitors are of the same model and configured identically except for the orientation.

When the window loses focus from fullscreen it minimizes as expected, but then becomes distorted as in this screenshot This is not visible when taking a screenshot using the steam overlay (looks as if the screen was normal). The mouse is restricted to a small portion of the monitor in the top left corner and the only work around I have found is to move the window to the left or right monitor (which enables regular mouse control, but the screen is distorted as in this screenshot) then changing video settings to windowed mode, moving it to center monitor and finally changing settings to fullscreen again.

The issue is not present when using windowed mode, but then the performace suffers too much to use it because of my distro's compositor muffin (a mutter fork, based on clutter).

If there is any more information I can provide, please let me know.

Steps for reproducing this issue:

  1. Rotate Left and Right monitors clockwise to vertical orientation, Center monitor not rotated.
  2. Set CS:GO to run in fullscreen on center monitor
  3. Lose window focus
  4. Restore window
apenglow commented 7 years ago

I've experienced this as well. I have noticed that it only happens on GNOME and Cinnamon. KDE and XFCE are not affected by this bug.

Workaround (Works on GNOME and Cinnamon):

  1. Minimize CS:GO
  2. Move it to the leftmost monitor.
  3. Move it back to your main monitor
  4. Maximize and it should be fixed.
schulzh commented 7 years ago

I am experiencing it aswell (Antergos Arch Linux; Cinnamon). Its not specific to CSGO though, the same happens in CSS and TF2, so it looks like a general Source issue. EDIT: Does not happen in HL2, so not a general Source issue after all.

kisak-valve commented 7 years ago

@rcgordon, happen to have some insight if this is a SDL issue?

icculus commented 7 years ago

@kisak-valve, I don't know yet, but it definitely sounds like one. Feel free to assign this bug to me for now!

DrDoctor13 commented 7 years ago

I have the exact same problem and it happens in TF2, CS:S, and CS:GO in Gnome Shell. It doesn't happen to HL2 or L4D2.

My Steam System Information: https://gist.github.com/DrDoctor13/4c77ac608241c451f7fddc18c05a0d4f

@kmate88 I have no way to open it on a specific monitor or move it after it's open. This seems to be a bug in Mutter/Muffin, not Kwin or whatever WM Xfce uses.

DrDoctor13 commented 7 years ago

Actually my mistake @kmate88 you can't drag it in the Activities view but you can use Super+Shift+Left and Super+Shift+Right.

kiroma commented 7 years ago

In a Source engine game that doesn't have a custom video settings window, like Black Mesa, I noticed you can set which monitor you want to use for fullscreen resolution. Maybe the best solution would be to scrap the pretty visual menus for usable ones?

lodi-g commented 7 years ago

Experiencing this as well. Archlinux with GNOME, two 21" FHD monitors and one 27" WQHD. When switching to another window (Alt+Tab) when CSGO is started as fullscreen or fullscreen windowed, CSGO will go back to 1920x1080 instead of 2560x1440 and will be positioned in the lower left corner of the 27" screen.

maksymovi commented 6 years ago

Can confirm this is still an issue. I have 3 monitors, am running Ubuntu 18.04. Game starts on the wrong monitor, moving it to my center monitor with super+shift+arrow produces this bug. Nothing I change in the graphics settings fixes it.

Edit: kmate88's workaround works for me.

ben-whale commented 6 years ago

I have the same behaviour as Styil (same OS), but I fixed it.

In the X-org server I have two monitors, a smaller one which sits to the left of the larger main monitor. CSGO would open on the smaller monitor and when alt tabbing with the game full screened on the main monitor would (to my eye) take on the aspect ratio / scaled pixel dimensions of the smaller screen while csgo was still displayed on the main monitor.

I have now configured X-org so that my main monitor is the left hand most monitor. This has resolve my alt tabbing issues. Of course I know have to move my mouse right to make it appear on a physical monitor that is to the left.

The change to achieve this is pretty easy in the NVideo X server configuration program.

ben-whale commented 6 years ago

Fix / Janky workaround. I suspect the difference is how old your legacy code is.

ijash commented 6 years ago

I confirm this is an issue. i am using 2 monitors on Linux Mint.

System:    Host: Ijash-LM-PC Kernel: 4.15.0-33-generic x86_64 bits: 64 gcc: 7.3.0
           Desktop: Cinnamon 3.8.8 (Gtk 3.22.30-1ubuntu1) dm: lightdm Distro: Linux Mint 19 Tara
Machine:   Device: desktop System: Gigabyte product: Z270X-UD3 serial: N/A
           Mobo: Gigabyte model: Z270X-UD3-CF v: x.x serial: N/A
           UEFI: American Megatrends v: F7 date: 07/07/2017
CPU:       Quad core Intel Core i7-7700K (-MT-MCP-) arch: Skylake rev.9 cache: 8192 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 33600
           clock speeds: min/max: 800/4500 MHz 1: 827 MHz 2: 844 MHz 3: 1238 MHz 4: 870 MHz 5: 1376 MHz
           6: 807 MHz 7: 883 MHz 8: 1134 MHz
Graphics:  Card: NVIDIA GM206 [GeForce GTX 950] bus-ID: 01:00.0 chip-ID: 10de:1402
           Display Server: x11 (X.Org 1.19.6 ) driver: nvidia
           Resolution: 1360x768@59.96hz, 1920x1080@60.00hz
           OpenGL: renderer: GeForce GTX 950/PCIe/SSE2 version: 4.6.0 NVIDIA 396.54 Direct Render: Yes
Audio:     Card-1 NVIDIA Device 0fba driver: snd_hda_intel bus-ID: 01:00.1 chip-ID: 10de:0fba
           Card-2 Intel 200 Series PCH HD Audio driver: snd_hda_intel bus-ID: 00:1f.3 chip-ID: 8086:a2f0
           Sound: Advanced Linux Sound Architecture v: k4.15.0-33-generic
Network:   Card: Intel Ethernet Connection (2) I219-V
           driver: e1000e v: 3.2.6-k bus-ID: 00:1f.6 chip-ID: 8086:15b8
           IF: enp0s31f6 state: up speed: 100 Mbps duplex: full mac: <filter>
Drives:    HDD Total Size: 4751.0GB (7.4% used)
           ID-1: /dev/sda model: Samsung_SSD_850 size: 250.1GB serial: <filter>
           ID-2: /dev/sdb model: HGST_HTS545050A7 size: 500.1GB serial: <filter>
           ID-3: /dev/sdc model: WDC_WD30EZRZ size: 3000.6GB serial: <filter>
           ID-4: /dev/sdd model: ST1000DM003 size: 1000.2GB serial: <filter>
Partition: ID-1: / size: 219G used: 16G (8%) fs: ext4 dev: /dev/sda2
           ID-2: /var/log size: 92G used: 324M (1%) fs: ext4 dev: /dev/sdd4
           ID-3: /home size: 459G used: 296G (68%) fs: ext4 dev: /dev/sdd2
           ID-4: swap-1 size: 16.85GB used: 0.00GB (0%) fs: swap dev: /dev/sdd1
RAID:      System: supported: N/A
           No RAID devices: /proc/mdstat, md_mod kernel module present
           Unused Devices: none
Sensors:   System Temperatures: cpu: 29.8C mobo: 27.8C gpu: 0.0:42C
           Fan Speeds (in rpm): cpu: N/A
Repos:     Active apt sources in file: /etc/apt/sources.list.d/atareao-telegram-bionic.list
           deb http: //ppa.launchpad.net/atareao/telegram/ubuntu bionic main
           deb-src http: //ppa.launchpad.net/atareao/telegram/ubuntu bionic main
           Active apt sources in file: /etc/apt/sources.list.d/atom.list
           deb [arch=amd64] https: //packagecloud.io/AtomEditor/atom/any/ any main
           Active apt sources in file: /etc/apt/sources.list.d/etcher.list
           deb https: //dl.bintray.com/resin-io/debian stable etcher
           Active apt sources in file: /etc/apt/sources.list.d/fossfreedom-arc-gtk-theme-daily-bionic.list
           deb http: //ppa.launchpad.net/fossfreedom/arc-gtk-theme-daily/ubuntu bionic main
           deb-src http: //ppa.launchpad.net/fossfreedom/arc-gtk-theme-daily/ubuntu bionic main
           Active apt sources in file: /etc/apt/sources.list.d/graphics-drivers-ppa-bionic.list
           deb http: //ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic main
           deb-src http: //ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic main
           Active apt sources in file: /etc/apt/sources.list.d/nodesource.list
           deb https: //deb.nodesource.com/node_8.x bionic main
           deb-src https: //deb.nodesource.com/node_8.x bionic main
           Active apt sources in file: /etc/apt/sources.list.d/official-package-repositories.list
           deb http: //kartolo.sby.datautama.net.id/linuxmint tara main upstream import backport
           deb http: //suro.ubaya.ac.id/ubuntu bionic main restricted universe multiverse
           deb http: //suro.ubaya.ac.id/ubuntu bionic-updates main restricted universe multiverse
           deb http: //suro.ubaya.ac.id/ubuntu bionic-backports main restricted universe multiverse
           deb http: //security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
           deb http: //archive.canonical.com/ubuntu/ bionic partner
           Active apt sources in file: /etc/apt/sources.list.d/papirus-papirus-bionic.list
           deb http: //ppa.launchpad.net/papirus/papirus/ubuntu bionic main
           deb-src http: //ppa.launchpad.net/papirus/papirus/ubuntu bionic main
           Active apt sources in file: /etc/apt/sources.list.d/spotify.list
           deb http: //repository.spotify.com stable non-free
           Active apt sources in file: /etc/apt/sources.list.d/tista-adapta-bionic.list
           deb http: //ppa.launchpad.net/tista/adapta/ubuntu bionic main
           deb-src http: //ppa.launchpad.net/tista/adapta/ubuntu bionic main
           Active apt sources in file: /etc/apt/sources.list.d/uget-team-ppa-bionic.list
           deb http: //ppa.launchpad.net/uget-team/ppa/ubuntu bionic main
           deb-src http: //ppa.launchpad.net/uget-team/ppa/ubuntu bionic main
           Active apt sources in file: /etc/apt/sources.list.d/virtualbox.list
           deb [arch=amd64] http: //download.virtualbox.org/virtualbox/debian bionic contrib
           Active apt sources in file: /etc/apt/sources.list.d/vscode.list
           deb [arch=amd64] http: //packages.microsoft.com/repos/vscode stable main
Info:      Processes: 255 Uptime: 59 min Memory: 2672.9/15989.6MB
           Init: systemd v: 237 runlevel: 5 Gcc sys: 7.3.0 alt: 6
           Client: Unknown python3.6 client inxi: 2.3.56
lephisto commented 6 years ago

Still an Issue! Will this be addressed anytime or do I have to reinstall Windows again?

schulzh commented 6 years ago

My current workaround is to not minimize CS:GO. You can avoid minimizing on focus loss by setting the environment variable SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0 %command% via Launch Options. You can then switch to other Windows and have CS:GO running in the background.

BTW, @kmate88 's Workaround does not work for me anymore since Panorama; while it fixes the resolution, the mouse behaves like it is still scaled. Only fix is to switch to windowed and back to fullscreen or to restart CS:GO.

willgleich commented 5 years ago

also confirming this issue running linux mint with multiple monitors

FailedCode commented 5 years ago

After some update of Ubuntu 18.04 broke gdm3 and didn't let me login at all, I uninstalled that and use again lightdm and Unity instead of Ubuntu Desktop - no problems with starting on the wrong monitor or using the wrong aspect ratio. GeForce GTX 960 with driver version 390.87 Kernel: 4.15.0-42-generic

ourex commented 5 years ago

Can confirm issue on Ubuntu 18.10. Valve please fix

tnoell commented 5 years ago

@schulzh That workaround doesn't work for me. Only thing that fixes it is setting the monitor to be the leftmost one in display settings.

schulzh commented 5 years ago

@tnoell What exactly does not work? It is important that CS:GO is set to Fullscreen (not Fullscreen Windowed) and that it already launches on the correct monitor; moving it will not work.

tnoell commented 5 years ago

@schulzh Sorry, I didn't realize I had to put %command% behind it in the launch options. Works now!

Disk1of5 commented 5 years ago

hey @rcgordon hope you are doing well, any news on this bug? lately the only way i can launch CSGO correctly is creating a bash scripts that disables all my other monitors except primary, Then re-enabling after im done carrying my team for 3-4 rounds :)

Thanks!

fredsif commented 4 years ago

I'm having that same issue too. When I do alt-tab and go back to the game, the resolution is all messed up. I've tried to do Window mode, dragging it to the main monitor, go back to fullscreen mode, quit the game, restart, the game launches in my main monitor looking fine but then when I alt-tab it, it keeps doing the same.

I have no idea what to do.

Here's my computer config:

Operating System Version:
    Linux Mint 19.3 Tricia (64 bit)
    Kernel Name:  Linux
    Kernel Version:  5.3.0-40-generic
    X Server Vendor:  The X.Org Foundation
    X Server Release:  11906000
    X Window Manager:  Mutter (Muffin)
    Steam Runtime Version:  steam-runtime_0.20200204.0

Video Card:
    Driver:  NVIDIA Corporation GeForce GTX 1060 6GB/PCIe/SSE2
    Driver Version:  4.6.0 NVIDIA 440.59
    OpenGL Version: 4.6
    Desktop Color Depth: 24 bits per pixel
    Monitor Refresh Rate: 60 Hz
    VendorID:  0x10de
    DeviceID:  0x1c03
    Revision Not Detected
    Number of Monitors:  2
    Number of Logical Video Cards:  1
    Primary Display Resolution:  1920 x 1080
    Desktop Resolution: 3200 x 1080
    Primary Display Size: 20.91" x 11.77" (23.98" diag)
                                            53.1cm x 29.9cm (60.9cm diag)
    Primary Bus: PCI Express 16x
    Primary VRAM: 6144 MB
    Supported MSAA Modes:  2x 4x 8x 16x 
yoyossef commented 4 years ago

Same issue unfortunately. Screenshot from 2020-06-11 02-29-24

Redneckita commented 4 years ago

My current workaround is to not minimize CS:GO. You can avoid minimizing on focus loss by setting the environment variable SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0 %command% via Launch Options. You can then switch to other Windows and have CS:GO running in the background.

BTW, @kmate88 's Workaround does not work for me anymore since Panorama; while it fixes the resolution, the mouse behaves like it is still scaled. Only fix is to switch to windowed and back to fullscreen or to restart CS:GO.

You're an hero man, worked perfectly. Every time i alt-tabbed the game or received a message the game did not go back to fullscreen