Hi,
does anyone here also has problems with minimizing a fullscreen window (gl
context) on OSX? I have a visit-my-homepage-button in my game that
minimizes the window, and opens a url - this works perfectly on android,
windows, linux - but not on osx. The screen stays black - and the game
doesn’t respond anymore for a random time. Even the mouse input seems to be
broken after it recovered (wrong coordinates). The code is here:
}
void SDLFrontend::disableScissor ()
{
SDL_assert(_renderer);
SDL_RenderSetClipRect(_renderer, nullptr);
}
void SDLFrontend::onWindowRestore ()
{
#if __APPLE__
Log::info(LOG_COMMON, "restored");
const ConfigVarPtr& var = Config.getConfigVar("fullscreen");
setFullscreen(var->getBoolValue());
#endif
}
void SDLFrontend::minimize ()
{
#ifdef __APPLE__
SDL_SetWindowFullscreen(_window, SDL_FALSE);
IFrontend *_frontend;
bool _newWindow;
public:
OpenURLListener (IFrontend *frontend, const std::string& url, bool newWindow = true) :
_url(url), _frontend(frontend), _newWindow(newWindow)
{
}
void onClick () override
{
_frontend->minimize();
System.openURL(_url, _newWindow);
}
};
#ifdef __EMSCRIPTEN__
class EmscriptenFullscreenListener: public UINodeListener {
public:
void onClick () {
EM_ASM({
Module.requestFullScreen();
#include "Darwin.h"
#include "DarwinObjc.h"
#include "common/Application.h"
#include <CoreServices/CoreServices.h>
Darwin::Darwin () :
Unix()
{
darwinInit();
}
Darwin::~Darwin ()
{
}
int Darwin::openURL (const std::string& url, bool) const
{
CFURLRef cfurl = CFURLCreateWithBytes(nullptr, (const uint8_t *) url.c_str(),
url.length(), kCFStringEncodingUTF8, nullptr);
const bool success = LSOpenCFURLRef(cfurl, nullptr) == noErr;
CFRelease(cfurl);
return success ? 0 : -1;
}
Thanks for your help.–
http://www.caveproductions.org