| Summary: | Disabling fullscreen reduces the window size | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Egor <blckcat> |
| Component: | video | Assignee: | 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 | ||
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 Indeed is is. I probably didn't google enough... |
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