Browse Source

Windows: Also extend client frame when running on Windows 11

Fixes #300
pull/299/head
Jannis Weis 3 years ago
parent
commit
4453ce13a7
No known key found for this signature in database
GPG Key ID: 7C9D8D4B558049AB
  1. 14
      windows/src/main/cpp/Decorations.cpp

14
windows/src/main/cpp/Decorations.cpp

@ -1,7 +1,7 @@
/* /*
* MIT License * 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 * 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, * 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; if (it != wrapper_map.end()) return false;
SetupWindowStyle(handle); SetupWindowStyle(handle);
if (is_popup || !is_windows_11) { ExtendClientFrame(handle);
ExtendClientFrame(handle); if (is_popup) {
if (is_popup) { auto attribute = DWMWINDOWATTRIBUTE::DWMWA_WINDOW_CORNER_PREFERENCE;
auto attribute = DWMWINDOWATTRIBUTE::DWMWA_WINDOW_CORNER_PREFERENCE; auto preference = DWM_WINDOW_CORNER_PREFERENCE::DWMWCP_ROUNDSMALL;
auto preference = DWM_WINDOW_CORNER_PREFERENCE::DWMWCP_ROUNDSMALL; DwmSetWindowAttribute(handle, attribute, &preference, sizeof(preference));
DwmSetWindowAttribute(handle, attribute, &preference, sizeof(preference));
}
} }
WNDPROC proc = reinterpret_cast<WNDPROC>(GetWindowLongPtr(handle, GWLP_WNDPROC)); WNDPROC proc = reinterpret_cast<WNDPROC>(GetWindowLongPtr(handle, GWLP_WNDPROC));

Loading…
Cancel
Save