|
67 | 67 | #define DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 19
|
68 | 68 | #endif
|
69 | 69 |
|
| 70 | +#ifndef DWMWA_WINDOW_CORNER_PREFERENCE |
| 71 | +#define DWMWA_WINDOW_CORNER_PREFERENCE 33 |
| 72 | +#endif |
| 73 | + |
| 74 | +#ifndef DWMWCP_DEFAULT |
| 75 | +#define DWMWCP_DEFAULT 0 |
| 76 | +#endif |
| 77 | + |
| 78 | +#ifndef DWMWCP_DONOTROUND |
| 79 | +#define DWMWCP_DONOTROUND 1 |
| 80 | +#endif |
| 81 | + |
70 | 82 | #define WM_INDICATOR_CALLBACK_MESSAGE (WM_USER + 1)
|
71 | 83 |
|
72 | 84 | #if defined(__GNUC__)
|
@@ -1483,6 +1495,9 @@ DisplayServer::WindowID DisplayServerWindows::create_sub_window(WindowMode p_mod
|
1483 | 1495 | if (p_flags & WINDOW_FLAG_ALWAYS_ON_TOP_BIT && p_mode != WINDOW_MODE_FULLSCREEN && p_mode != WINDOW_MODE_EXCLUSIVE_FULLSCREEN) {
|
1484 | 1496 | wd.always_on_top = true;
|
1485 | 1497 | }
|
| 1498 | + if (p_flags & WINDOW_FLAG_SHARP_CORNERS_BIT) { |
| 1499 | + wd.sharp_corners = true; |
| 1500 | + } |
1486 | 1501 | if (p_flags & WINDOW_FLAG_NO_FOCUS_BIT) {
|
1487 | 1502 | wd.no_focus = true;
|
1488 | 1503 | }
|
@@ -2297,6 +2312,12 @@ void DisplayServerWindows::window_set_flag(WindowFlags p_flag, bool p_enabled, W
|
2297 | 2312 | wd.always_on_top = p_enabled;
|
2298 | 2313 | _update_window_style(p_window);
|
2299 | 2314 | } break;
|
| 2315 | + case WINDOW_FLAG_SHARP_CORNERS: { |
| 2316 | + wd.sharp_corners = p_enabled; |
| 2317 | + DWORD value = wd.sharp_corners ? DWMWCP_DONOTROUND : DWMWCP_DEFAULT; |
| 2318 | + ::DwmSetWindowAttribute(wd.hWnd, DWMWA_WINDOW_CORNER_PREFERENCE, &value, sizeof(value)); |
| 2319 | + _update_window_style(p_window); |
| 2320 | + } break; |
2300 | 2321 | case WINDOW_FLAG_TRANSPARENT: {
|
2301 | 2322 | if (p_enabled) {
|
2302 | 2323 | // Enable per-pixel alpha.
|
@@ -3994,6 +4015,10 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
|
3994 | 4015 | native_menu->_menu_activate(HMENU(lParam), (int)wParam);
|
3995 | 4016 | } break;
|
3996 | 4017 | case WM_CREATE: {
|
| 4018 | + { |
| 4019 | + DWORD value = windows[window_id].sharp_corners ? DWMWCP_DONOTROUND : DWMWCP_DEFAULT; |
| 4020 | + ::DwmSetWindowAttribute(windows[window_id].hWnd, DWMWA_WINDOW_CORNER_PREFERENCE, &value, sizeof(value)); |
| 4021 | + } |
3997 | 4022 | if (is_dark_mode_supported() && dark_title_available) {
|
3998 | 4023 | BOOL value = is_dark_mode();
|
3999 | 4024 |
|
@@ -5645,6 +5670,12 @@ DisplayServer::WindowID DisplayServerWindows::_create_window(WindowMode p_mode,
|
5645 | 5670 | wd_transient_parent->transient_children.insert(id);
|
5646 | 5671 | }
|
5647 | 5672 |
|
| 5673 | + wd.sharp_corners = p_flags & WINDOW_FLAG_SHARP_CORNERS_BIT; |
| 5674 | + { |
| 5675 | + DWORD value = wd.sharp_corners ? DWMWCP_DONOTROUND : DWMWCP_DEFAULT; |
| 5676 | + ::DwmSetWindowAttribute(wd.hWnd, DWMWA_WINDOW_CORNER_PREFERENCE, &value, sizeof(value)); |
| 5677 | + } |
| 5678 | + |
5648 | 5679 | if (is_dark_mode_supported() && dark_title_available) {
|
5649 | 5680 | BOOL value = is_dark_mode();
|
5650 | 5681 | ::DwmSetWindowAttribute(wd.hWnd, use_legacy_dark_mode_before_20H1 ? DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 : DWMWA_USE_IMMERSIVE_DARK_MODE, &value, sizeof(value));
|
|
0 commit comments