mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
Revert 4ce53cb8
: [OSX] Delayed fullscreen switch is not needed anymore.
The fix for #8067 solves the real issue, making this workaround unneeded.
This commit is contained in:
parent
6e8be3b03e
commit
979b4af6ca
@ -18,7 +18,6 @@ extern bool _cocoa_video_started;
|
|||||||
|
|
||||||
class VideoDriver_Cocoa : public VideoDriver {
|
class VideoDriver_Cocoa : public VideoDriver {
|
||||||
private:
|
private:
|
||||||
bool fullscreen_on_mainloop; ///< Switch to fullscreen once the main loop is running?
|
|
||||||
Dimension orig_res; ///< Saved window size for non-fullscreen mode.
|
Dimension orig_res; ///< Saved window size for non-fullscreen mode.
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -156,6 +156,7 @@ static void QZ_UpdateVideoModes()
|
|||||||
static CocoaSubdriver *QZ_CreateSubdriver(int width, int height, int bpp, bool fullscreen, bool fallback)
|
static CocoaSubdriver *QZ_CreateSubdriver(int width, int height, int bpp, bool fullscreen, bool fallback)
|
||||||
{
|
{
|
||||||
CocoaSubdriver *ret = QZ_CreateWindowQuartzSubdriver(width, height, bpp);
|
CocoaSubdriver *ret = QZ_CreateWindowQuartzSubdriver(width, height, bpp);
|
||||||
|
if (ret != nullptr && fullscreen) ret->ToggleFullscreen(fullscreen);
|
||||||
|
|
||||||
if (ret != nullptr) return ret;
|
if (ret != nullptr) return ret;
|
||||||
if (!fallback) return nullptr;
|
if (!fallback) return nullptr;
|
||||||
@ -209,9 +210,6 @@ const char *VideoDriver_Cocoa::Start(const StringList &parm)
|
|||||||
return "The cocoa quartz subdriver only supports 8 and 32 bpp.";
|
return "The cocoa quartz subdriver only supports 8 and 32 bpp.";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Defer fullscreen toggle until the main loop is running,
|
|
||||||
* as otherwise a grey bar will be stuck on top of the window. */
|
|
||||||
this->fullscreen_on_mainloop = _fullscreen;
|
|
||||||
_cocoa_subdriver = QZ_CreateSubdriver(width, height, bpp, _fullscreen, true);
|
_cocoa_subdriver = QZ_CreateSubdriver(width, height, bpp, _fullscreen, true);
|
||||||
if (_cocoa_subdriver == NULL) {
|
if (_cocoa_subdriver == NULL) {
|
||||||
Stop();
|
Stop();
|
||||||
|
@ -652,12 +652,6 @@ void VideoDriver_Cocoa::GameLoop()
|
|||||||
|
|
||||||
while (QZ_PollEvent()) {}
|
while (QZ_PollEvent()) {}
|
||||||
|
|
||||||
/* If we do that right after window creation, a grey bar will be left at the top. */
|
|
||||||
if (this->fullscreen_on_mainloop) {
|
|
||||||
this->fullscreen_on_mainloop = false;
|
|
||||||
_cocoa_subdriver->ToggleFullscreen(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_exit_game) {
|
if (_exit_game) {
|
||||||
/* Restore saved resolution if in fullscreen mode. */
|
/* Restore saved resolution if in fullscreen mode. */
|
||||||
if (_cocoa_subdriver->IsFullscreen()) _cur_resolution = this->orig_res;
|
if (_cocoa_subdriver->IsFullscreen()) _cur_resolution = this->orig_res;
|
||||||
|
Loading…
Reference in New Issue
Block a user