SDL2: two displays, two windows and fullscreen mode

扶醉桌前 提交于 2019-12-06 05:29:00

I debug step by step and found the reason in SDL_video.c::SDL_OnWindowFocusLost(SDL_Window * window)

SDL_OnWindowFocusLost(SDL_Window * window)
{
    if (window->gamma && _this->SetWindowGammaRamp) {
        _this->SetWindowGammaRamp(_this, window, window->saved_gamma);
    }

    SDL_UpdateWindowGrab(window);

    if (ShouldMinimizeOnFocusLoss(window)) {
        SDL_MinimizeWindow(window);
    }
}

So the problem is here "if (ShouldMinimizeOnFocusLoss(window))".

To solve the problem, I add the following code before creating the window:

SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!