Re: [hatari-devel] Feedback SDL2 support

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


I'm currently investigating the code in Aranym, and it seems that there might be similar problems with SDL2 and fulllscreen

> SDL_SetWindowSize(sdlWindow, bInFullScreen ? WWWW : width,
>                                            bInFullScreen ? HHHH : height);

in SDL2, SDL_SetWindowSize only sets the size of the window when NOT being fullscreen. The size is remembered even when currently in fullscreen mode, so SDL_SetWindowSize should probably not be called at all when in fulllscreen mode. Similarly, unlike SDL 1.x, SDL_GetWindowDisplayMode()/SDL_SetWindowDisplayMode() get/set the size of the fulllscreen mode, not the current size of the window.



Thomas Huth <th.huth@xxxxxx> schrieb am 22:35 Mittwoch, 2.Dezember 2015:


Am Mon, 30 Nov 2015 01:15:53 -0700 (MST)
schrieb David Savinkoff <dsavnkff@xxxxxxxxx>:
>
> "Keep desktop resolution - Selected" still has a problem of losing
> window focus on my system. I think SDL2 events become misdirected
> to hatari's parent process (or whatever window the cursor is over when
> F11 is pressed) instead of hatari... I noticed that typed keystrokes
> start showing up in the terminal window where hatari was launched
> after window focus is lost.

That's odd. It works fine for on my system. Anyway, could you please
try these two things independently, to see whether they cure this issue:

1)

Locate this code sequence in screen.c:

    if (sdlWindow)
    {
        SDL_SetWindowSize(sdlWindow, width, height);
    }
    else
    {
        sdlWindow = SDL_CreateWindow("Hatari", SDL_WINDOWPOS_UNDEFINED,
                                    SDL_WINDOWPOS_UNDEFINED,
                                    width, height, sdlVideoFlags);
    }

And replace it with this:

    if (sdlWindow)
    {
        SDL_SetWindowSize(sdlWindow, bInFullScreen ? WWWW : width,
                                            bInFullScreen ? HHHH : height);
    }
    else
    {
        sdlWindow = SDL_CreateWindow("Hatari", SDL_WINDOWPOS_UNDEFINED,
                                    SDL_WINDOWPOS_UNDEFINED,
                                    bInFullScreen ? WWWW : width,
                                            bInFullScreen ? HHHH : height,
                                            sdlVideoFlags);
    }

... where WWWW is the width of your host screen and HHHH the height
(i.e. fill in your desktop resolution values).


2) If the first experiment does not help, please try to add a

    SDL_RaiseWindow(sdlWindow);

at the end of the Screen_SetSDLVideoSize() function.


Thomas






Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/