Hello,
I’m using SDL 2.0.9 on Windows 10 64bits, and I try to create a window with no borders and title bar using the SDL_SetWindowBordered function. At first, it seems to work. But if I change the input focus, by clicking on the taskbar for example, a thick grey border and a blue title bar shows up in the window.
I tried to repaint the background on every frame, and it kinda works, but then the window starts to flicker between the title bar and the background color. I also tried to disable Win32 styles and ex styles manually from the Win32 handle, but it does nothing about that.
Here’s the minimal required code to reproduce it :
#define SDL_MAIN_HANDLED
#include <SDL2/SDL.h>
int main()
{
SDL_Init( SDL_INIT_VIDEO | SDL_INIT_EVENTS );auto sdl2_window = SDL_CreateWindow(
“Window”,
SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED,
800,
600,
SDL_WINDOW_RESIZABLE
);SDL_SetWindowBordered( sdl2_window, SDL_FALSE );
bool run{ true };
while ( run )
{
SDL_Event event{};
SDL_PollEvent( &event );
if ( event.type == SDL_WINDOWEVENT && event.window.event == SDL_WINDOWEVENT_CLOSE )
run = false;
}SDL_DestroyWindow( sdl2_window );
return 0;
}
And a picture of the result :
Thanks!