We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3896

Summary: Disabling fullscreen reduces the window size
Product: SDL Reporter: Egor <blckcat>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED DUPLICATE QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: blckcat, ewasylishen
Version: 2.0.6   
Hardware: x86   
OS: Windows 7   

Description Egor 2017-10-20 18:15:32 UTC
I've noticed that each time a fullscreen mode is disabled for a window, its size is reduced.
It appears that sizes of top and left borders are subtracted from width and height respectively.

Demo:

    SDL_Init(SDL_INIT_VIDEO);
    int w, h;
    SDL_Event e;
    SDL_Window *handle = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 800, 600, 0);
    for (int i = 0; i < 3; i++)
    {
        SDL_SetWindowFullscreen(handle, SDL_WINDOW_FULLSCREEN);
        while (SDL_PollEvent(&e)) {}
        SDL_GetWindowSize(handle, &w, &h);
        printf("[%d;%d] - fullscreen\n", w, h);
        SDL_Delay(3000);
        SDL_SetWindowFullscreen(handle, 0);
        while (SDL_PollEvent(&e)) {}
        SDL_GetWindowSize(handle, &w, &h);
        printf("[%d;%d] - windowed\n", w, h);
        SDL_Delay(3000);
    }

What it outputs:

    [800;600] - fullscreen
    [794;575] - windowed
    [800;600] - fullscreen
    [788;550] - windowed
    [800;600] - fullscreen
    [782;525] - windowed
Comment 1 Eric Wasylishen 2017-10-20 18:35:02 UTC
This sounds like a duplicate of https://bugzilla.libsdl.org/show_bug.cgi?id=3887 - if so it should be fixed in hg / 2.0.7
Comment 2 Egor 2017-10-20 18:55:08 UTC
Indeed is is. I probably didn't google enough...
Comment 3 Egor 2017-10-20 18:56:31 UTC
Closed

*** This bug has been marked as a duplicate of bug 3887 ***