Page 1 of 1

[0.17.65] [macOS] Freeze or crash when Mission Control used to put game in/out Full Screen, if Full Screen=off on launch

Posted: Thu Aug 15, 2019 1:12 am
by TheBloke
Version tested: 0.17.65
Platform: macOS 10.14.5
Hardware: AMD 7970Ghz (R9 280X) 3GB, in Mac Pro 5.1 (Hackintosh faked)

Factorio will freeze with a black screen for 30-35 seconds if the user opens it when configured to be not in Full Screen mode, then toggles it into Full Screen using Settings->Graphics, then uses Mission Control to take it out of Full Screen and then back in again. This black screen will recover on its own after ~35 seconds, however if during this time the user again drags it out of full screen using Mission Control, the game will crash.

Steps to reproduce:
  1. Launch the game with Full Screen disabled.
  2. Upon reaching main menu, go to Settings->Graphics and turn Full Screen on.
  3. Now open Mission Control, and drag Factorio out of Full Screen mode, back to the desktop. This effectively reverts the Full Screen setting, although Settings->Graphics will still say Full Screen is on (normally this causes no issues.)
  4. Still in Mission Control, drag Factorio back up to the Desktops/Spaces bar at the top, putting it back into Full Screen.
  5. There will be a pause/stutter, and the Factorio window will now appear black.
  6. If you click into Factorio and wait 30-35 seconds, eventually this black screen will correct itself, and the game appears as normal and runs fine (though it will go black again for another ~30 seconds if steps 3-4 are repeated.)
  7. However if instead you drag Factorio back down to the current desktop, causing it to try and go out of Full Screen mode again, it will now crash.
Given the unusual steps to re-create, I made a quick video showing the issue, In case that is of any help: https://streamable.com/9jla4. It shows the game going black for a few seconds, then rather than waiting for 30+ seconds, I cause it to crash by bringing it out of full screen again.

The trigger appears to be the combination of loading the game with Settings->Graphics->Full Screen = off and then changing Settings->Graphics->Full Screen to on. If the game is set to Full Screen at load time then it is fine to toggle it in and out of full screen mode, both using Settings->Graphics and Mission Control. If it's loaded with Full Screen=off, then it's still OK to use Mission Control to bring it in and out of full screen, as long as Settings->Graphics->Full Screen is not set to on.

I first had this crash a day or two ago on 0.17.64, and worked out how to reproduce it tonight on 0.17.65. I can't tell if the issue existed before .64, as I normally always have the game set to Full Screen at launch so I wouldn't have been able to trigger it until this week.

Log file:
macOS-0.17.65-Crash-SDL.factorio.vanilla.log
(20.68 KiB) Downloaded 82 times

Re: [0.17.65] [macOS] Freeze or crash when Mission Control used to put game in/out Full Screen, if Full Screen=off on la

Posted: Thu Aug 15, 2019 10:32 am
by posila
Thanks for the report.
I've looked into it and didn't manage to fully fix it. For 0.17.66 I made a change that makes the freeze only ~2 seconds long, making the issue much less sever. Hopefully it doesn't break anything else.

Re: [0.17.65] [macOS] Freeze or crash when Mission Control used to put game in/out Full Screen, if Full Screen=off on la

Posted: Thu Aug 15, 2019 11:38 am
by TheBloke
That sounds like it will be fine. It's a very niche problem anyway. Thanks for the fast fix!

Re: [0.17.65] [macOS] Freeze or crash when Mission Control used to put game in/out Full Screen, if Full Screen=off on la

Posted: Fri Aug 16, 2019 1:47 pm
by TheBloke
Hey posila, just to add that I can no longer re-create the crash in .66. The pause is short enough that I don't have a chance to pull the window back out of full screen using Mission Control, before it's recovered.

So this seems fine now. I suppose technically it's still an issue that it has that pause, but it's so minor I doubt anyone will even notice.

Thanks again.