by WhyNotHugo · 6y ago · 0 comments
Not _really_. The issue is that games are trying to do god-knows-what when they lose focus. In reality, they just need to ignore this happening.
Regular applications handle losing focus just fine, and games would too -- unless you try to do magic funky stuff when you lose focus (my guess is that they do this to work around funky WM issues on window that don't exist on Linux).
Also, it's much more complicated than that. When running in exclusive fullscreen mode (which almost all fullscreen games did before about 5 years ago), they have to do stuff like restore the original display resolution, tear down their graphics stack, and restore all of that when bringing the window back up. Many games depend on a very particular sequence of window messages during that process, including D3D handling some of those messages on their behalf in certain ways. In the case of non-exclusive or windowed mode games, they may choose to stop reading controller input, stop rendering, stop sending audio, etc. All of that requires correct window notifications in the correct order, and support in Wine for correctly tearing down and restoring all of those things.
And all that is just on the Windows side of the equation, you also need to tear down the Linux graphics stack and manage how X thinks about the windows in a way that the window manager will do the right thing for the user, without doing the /wrong/ thing for the app from the Windows perspective. For example if the WM chooses to resize the window when it requests fullscreen mode, at a time when Windows does not, then we have to ignore those messages, or the game will suddenly be rendering at the wrong size (or worse, infinite loop as the WM and the game fight over the window sizes... yeah, that happened[1]).
It's a nightmare. I've spent months and months on this stuff, and other devs have spent even more. If it was easy to fix, it would be fixed, I promise you :)
[1] https://github.com/ValveSoftware/wine/commit/4f590327ab2028a...
This is something that I find incredibly annoying: games handling their own resolution and having their own resolution configuration.
It's like their reinventing something that the OS already provides. Just use the resolution that's configured: if I wanted to change it I'd change it.
Non-native resolutions look awful on LCDs anyway, so apps really shouldn't change it.
Actually though, the easier way to support linux is just to run on windows mode with no chrome -- I can just fullscreen the window myself and that's it.
Games that try to detect screen resolution themselves very often screw up picking the right resolution when you have multiple screens: but again, the problem is they're trying to do too much.
Even with just one monitor, Unity (native) refuses to believe that 3840x1600 is what I want. Why are hardcoded resolution lists still a thing. At least Unity doesn't change the monitor resolution though, just the internal render resolution.
So you're saying you'd want to change desktop resolution each time you want to play a performance heavy game?
> Non-native resolutions look awful on LCDs anyway, so apps really shouldn't change it.
So you're saying developers should take away the options that people actively use because you subjectively don't like how it looks on your specific monitor?
Yes, for the Window definitely. If you need to drop the render resolution for perf then the game should upscale at the end (and for fucks sake, handle arbitrary aspect ratios correctly!!!). Personally though, I'd rather wait until I have hardware that can run the game at full resolution.
No, I'm saying they should remove it because they shouldn't aspire to reimplement an OS. I mean, why does a game need to have a panel to configure my hardware, my OS already has that.
Imagine if every single app out there implemented their own "screen resolution" management and settings panel.
It makes no sense.
AFAICT Proton already lies to games about the fullscreen resolution and silently upscales the result instead changing the monitor resolution (which I think might be the single most awesome thing Proton adds) so this isn't unprecedented.
As you noted: if the solution were so trivial it would have been done and shipped already.
I have had in the past month seen black screen on return. No controls after return. Does not tab out at all. There are other variations. Most games do work. But some dont. My wife plays dont starve quite a bit and that game is kind of flakey in its external behavior (once in game you are fine). One bug she is dealing with is in some cases it takes 30+ mins to get in game with new settings on a fairly beefy new computer.