cosmic-epoch icon indicating copy to clipboard operation
cosmic-epoch copied to clipboard

Fractional scaling incorrectly passes resolution to games run via Proton

Open kirawi opened this issue 1 year ago • 11 comments

With a 4K monitor, I'm restricted to resolutions far smaller, making the game look extremely stretched. This can be replicated with Black Desert Online, but I can search for other games this happens if none of you never experienced this behavior during testing.

kirawi avatar May 22 '24 23:05 kirawi

This is normal Xwayland behaviour with how scaling works.

Fixing this requires an unscaled Xwayland mode, like KDE has introduced: https://pointieststick.com/2022/06/17/this-week-in-kde-non-blurry-xwayland-apps/

Drakulix avatar May 23 '24 09:05 Drakulix

It sounds like a non-trivial feature. Are you aware of any workarounds generally or specifically for Proton for this off the top of your head? If not, no worries, and I'd dig into it myself.

kirawi avatar May 23 '24 15:05 kirawi

Are you aware of any workarounds generally or specifically for Proton for this off the top of your head? If not, no worries, and I'd dig into it myself.

I mean you can set the scale to 1.0 while playing...

I am not aware of any proton specific workarounds, wine applications (including proton) have to go through Xwayland.

But you might try to wrap the game with gamescope instead, which might apply it's own scaling logic to workaround this issue, since gamescope runs as a native wayland client.

Drakulix avatar May 23 '24 15:05 Drakulix

Will a unscaled Xwayland mode exist for for the first release?

tobyrg avatar May 25 '24 07:05 tobyrg

I'd definitely prefer an option to do X11 apps with either wayland or X scaling similar to what KDE does and GNOME 47 will (hopefully) implement! Blurry electron and other Xwayland apps are the main reason I still have to use Xorg on Gnome.

smathles avatar May 25 '24 12:05 smathles

Can we please have the KDE solution here?

Alex-Bujorianu avatar Jun 07 '24 16:06 Alex-Bujorianu

We will, but not for alpha 1.

Drakulix avatar Jun 07 '24 17:06 Drakulix

We will, but not for alpha 1.

OK. Do you have any timeline available for alpha 1, beta release etc.?

Alex-Bujorianu avatar Jun 07 '24 18:06 Alex-Bujorianu

We will, but not for alpha 1.

OK. Do you have any timeline available for alpha 1, beta release etc.?

Up to date estimates are in the monthly blog posts. You can see open issues for Alpha 1 here, release will not be before these are resolved: https://github.com/orgs/pop-os/projects/23

Fixing this particular issue is currently targeted at alpha 2.

Drakulix avatar Jun 07 '24 18:06 Drakulix

We will, but not for alpha 1.

OK. Do you have any timeline available for alpha 1, beta release etc.?

Up to date estimates are in the monthly blog posts. You can see open issues for Alpha 1 here, release will not be before these are resolved: https://github.com/orgs/pop-os/projects/23

Fixing this particular issue is currently targeted at alpha 2.

Thanks for the info. Looks like alpha 2 is going to be a long way off--I think I will use KDE until it is ready.

Alex-Bujorianu avatar Jun 07 '24 18:06 Alex-Bujorianu

I wonder how Hyprland implements this? I've been using it (hyprland) with the:

xwayland {
    force_zero_scaling = true
}

Setting and it is working.

Balssh avatar Aug 13 '24 15:08 Balssh

KDE like scaling for xwayland is available now under displays in cosmic settings or $HOME/.config/cosmic/com.system76.CosmicComp/v1/descale_xwayland

note it seems like xwayland works on the old scaling method, so at 4k %150 scale it renders at 5120 x 2880 which can really kill performance

Quackdoc avatar Sep 11 '24 07:09 Quackdoc

Great job devs, thanks for fixing this. I think this issue can be closed now?

Alex-Bujorianu avatar Sep 13 '24 15:09 Alex-Bujorianu

KDE like scaling for xwayland is available now under displays in cosmic settings or $HOME/.config/cosmic/com.system76.CosmicComp/v1/descale_xwayland

note it seems like xwayland works on the old scaling method, so at 4k %150 scale it renders at 5120 x 2880 which can really kill performance

So how can I make it so that games run at native resolution? KDE and Hyprland runs my games at 4k (3840x2160), while cosmic (or gnome, for that matter) runs them at 5120 x 2880. I had the descale_xwayland option on true

rompetomp avatar Mar 12 '25 07:03 rompetomp

KDE like scaling for xwayland is available now under displays in cosmic settings or $HOME/.config/cosmic/com.system76.CosmicComp/v1/descale_xwayland note it seems like xwayland works on the old scaling method, so at 4k %150 scale it renders at 5120 x 2880 which can really kill performance

So how can I make it so that games run at native resolution? KDE and Hyprland runs my games at 4k (3840x2160), while cosmic (or gnome, for that matter) runs them at 5120 x 2880. I had the descale_xwayland option on true

Have you tried Steam's gamescope compositor?

Alex-Bujorianu avatar Mar 12 '25 09:03 Alex-Bujorianu

So how can I make it so that games run at native resolution? KDE and Hyprland runs my games at 4k (3840x2160), while cosmic (or gnome, for that matter) runs them at 5120 x 2880. I had the descale_xwayland option on true

Just set the game internally to 4k. This will result in pixel-per-pixel output on your screen as the final scaling operation is done by cosmic-comp, which will be aware that the game resolution matches the output resolution.

Drakulix avatar Mar 12 '25 14:03 Drakulix

Have you tried Steam's gamescope compositor?

Good shout, I will try that. There are a couple of annoying things with gamescope though:

  • Closing the window, or using something like alt+F4 makes the gamescope process run, and I need to kill it manually. Closing the game from within the game works, but I sometimes alt+F4 out of habit
  • Most of the games I tried have issues with the cursor going out of the window, or stopping when it hits a corner. I can solve this with the force grab cursor option, but then the pointer speed is different than outside
  • It's annoying to set up gamescope for every game separately

Just set the game internally to 4k. This will result in pixel-per-pixel output on your screen as the final scaling operation is done by cosmic-comp, which will be aware that the game resolution matches the output resolution.

I tried this with Dota the other day, but it didn't give me the option to pick 3840x2160 for some reason, there were some weird resolution choices.

rompetomp avatar Mar 13 '25 18:03 rompetomp