From 4453ce13a79e56295577ece62e5c893f26340f67 Mon Sep 17 00:00:00 2001 From: Jannis Weis <31143295+weisJ@users.noreply.github.com> Date: Sat, 8 Jan 2022 18:21:49 +0100 Subject: [PATCH] Windows: Also extend client frame when running on Windows 11 Fixes #300 --- windows/src/main/cpp/Decorations.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/windows/src/main/cpp/Decorations.cpp b/windows/src/main/cpp/Decorations.cpp index e3d8671e..f751cede 100644 --- a/windows/src/main/cpp/Decorations.cpp +++ b/windows/src/main/cpp/Decorations.cpp @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2019-2021 Jannis Weis + * Copyright (c) 2019-2022 Jannis Weis * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and * associated documentation files (the "Software"), to deal in the Software without restriction, @@ -322,13 +322,11 @@ static bool InstallDecorations(HWND handle, bool is_popup) { if (it != wrapper_map.end()) return false; SetupWindowStyle(handle); - if (is_popup || !is_windows_11) { - ExtendClientFrame(handle); - if (is_popup) { - auto attribute = DWMWINDOWATTRIBUTE::DWMWA_WINDOW_CORNER_PREFERENCE; - auto preference = DWM_WINDOW_CORNER_PREFERENCE::DWMWCP_ROUNDSMALL; - DwmSetWindowAttribute(handle, attribute, &preference, sizeof(preference)); - } + ExtendClientFrame(handle); + if (is_popup) { + auto attribute = DWMWINDOWATTRIBUTE::DWMWA_WINDOW_CORNER_PREFERENCE; + auto preference = DWM_WINDOW_CORNER_PREFERENCE::DWMWCP_ROUNDSMALL; + DwmSetWindowAttribute(handle, attribute, &preference, sizeof(preference)); } WNDPROC proc = reinterpret_cast(GetWindowLongPtr(handle, GWLP_WNDPROC));