[client,sdl] respect -decorations

Disable window borders if requested, fixes #9673
This commit is contained in:
Armin Novak 2023-12-19 16:22:07 +01:00 committed by akallabeth
parent a7eeb8e1ba
commit 65da185275
2 changed files with 11 additions and 0 deletions

View File

@ -330,11 +330,19 @@ BOOL sdlDispContext::handle_window_event(const SDL_WindowEvent* ev)
{
WINPR_ASSERT(ev);
auto bordered = freerdp_settings_get_bool(_sdl->context()->settings, FreeRDP_Decorations)
? SDL_TRUE
: SDL_FALSE;
auto window = SDL_GetWindowFromID(ev->windowID);
if (window)
SDL_SetWindowBordered(window, bordered);
switch (ev->event)
{
case SDL_WINDOWEVENT_HIDDEN:
case SDL_WINDOWEVENT_MINIMIZED:
gdi_send_suppress_output(_sdl->context()->gdi, TRUE);
return TRUE;
case SDL_WINDOWEVENT_EXPOSED:

View File

@ -727,6 +727,9 @@ static BOOL sdl_create_windows(SdlContext* sdl)
window.offset_y = 0;
}
if (!freerdp_settings_get_bool(settings, FreeRDP_Decorations))
flags |= SDL_WINDOW_BORDERLESS;
window.window = SDL_CreateWindow(title, startupX, startupY, static_cast<int>(w),
static_cast<int>(h), flags);
if (!window.window)