5 ms·
> This is nice and all but they need to fix things like alt-tabbing in an out of a game. This is super hard to get right. It's somewhat wonky on Windows to beg
by coldpie 6y ago
> This is nice and all but they need to fix things like alt-tabbing in an out of a game.
This is super hard to get right. It's somewhat wonky on Windows to begin with (we have found plenty of games where it's broken on Windows), and then you have to factor in that X doesn't work the same way, and there are a hundred different window managers, which all work different ways. It should be significantly improved in 5.13, and we're still working on improvements in that area, including in upcoming 5.13 releases.
- WhyNotHugo 6y ago> This is super hard to get right. 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).
- coldpie 6y agoFirst, sure, if games didn't do complex things, it would be easier to support. But they do. So it is hard. 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/4f590327ab2028aadc6ac5b7c0ac10bd363e3c80 https://github.com/ValveSoftware/wine/commit/4f590327ab2028a...
- davedx 6y agoThank you for doing this kind of work. That commit is funny -- I've read that there's similar stuff in graphics card drivers too :)
- rasz 6y agoSince its all emulated why even tell the game its alt tabbed in the first place? Just keep it thinking nothing changed, its not like games do special stuff when in the background.
- coldpie 6y agoWe investigated that briefly. It's not as easy as it sounds, and even if it was, some games do useful things when they lose focus (e.g. auto pause the game, stop sending audio). We decided it wasn't worth pursuing.
- xenadu02 6y agoFrom one engineer to another: I'm sorry you keep having to deal with people who haven't spent a single minute working on this problem second-guessing your work. I get the same thing regularly and it can be very frustrating. As you noted: if the solution were so trivial it would have been done and shipped already.
- coldpie 6y agoHahaha! Nah, it's fine. Their suggestion was a good one; like I said, we did consider doing it. It's fun to talk about this stuff here on HN because the discussion is usually sensible. You should see the dumb crap they say on Reddit.
- account42 6y agoYou can work on something forever and still have others provide new insights. Feedback is not an attack, even if you have already considered that option (and even then there might be crucial details that could change things).
- sumtechguy 6y agoThe thing is (as a mostly windows gamer here) it is not consistent in windows really either. Then on top of that many of the companies that made these games went basically defunct years ago and some publisher is just selling them and cutting a check to some other company that is a shell corp for something else. You are correct on what should happen to the game. But some programs do need to react to lose focus. So for it to 'ignore' it there would need to be a setting for it (and per program). Which could even cause side effects in that game because they just plain got it wrong. 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.