|
@@ -67,6 +67,18 @@
|
|
#define DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 19
|
|
#define DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 19
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#ifndef DWMWA_WINDOW_CORNER_PREFERENCE
|
|
|
|
+#define DWMWA_WINDOW_CORNER_PREFERENCE 33
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#ifndef DWMWCP_DEFAULT
|
|
|
|
+#define DWMWCP_DEFAULT 0
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#ifndef DWMWCP_DONOTROUND
|
|
|
|
+#define DWMWCP_DONOTROUND 1
|
|
|
|
+#endif
|
|
|
|
+
|
|
#define WM_INDICATOR_CALLBACK_MESSAGE (WM_USER + 1)
|
|
#define WM_INDICATOR_CALLBACK_MESSAGE (WM_USER + 1)
|
|
|
|
|
|
#if defined(__GNUC__)
|
|
#if defined(__GNUC__)
|
|
@@ -1483,6 +1495,9 @@ DisplayServer::WindowID DisplayServerWindows::create_sub_window(WindowMode p_mod
|
|
if (p_flags & WINDOW_FLAG_ALWAYS_ON_TOP_BIT && p_mode != WINDOW_MODE_FULLSCREEN && p_mode != WINDOW_MODE_EXCLUSIVE_FULLSCREEN) {
|
|
if (p_flags & WINDOW_FLAG_ALWAYS_ON_TOP_BIT && p_mode != WINDOW_MODE_FULLSCREEN && p_mode != WINDOW_MODE_EXCLUSIVE_FULLSCREEN) {
|
|
wd.always_on_top = true;
|
|
wd.always_on_top = true;
|
|
}
|
|
}
|
|
|
|
+ if (p_flags & WINDOW_FLAG_SHARP_CORNERS_BIT) {
|
|
|
|
+ wd.sharp_corners = true;
|
|
|
|
+ }
|
|
if (p_flags & WINDOW_FLAG_NO_FOCUS_BIT) {
|
|
if (p_flags & WINDOW_FLAG_NO_FOCUS_BIT) {
|
|
wd.no_focus = true;
|
|
wd.no_focus = true;
|
|
}
|
|
}
|
|
@@ -2297,6 +2312,12 @@ void DisplayServerWindows::window_set_flag(WindowFlags p_flag, bool p_enabled, W
|
|
wd.always_on_top = p_enabled;
|
|
wd.always_on_top = p_enabled;
|
|
_update_window_style(p_window);
|
|
_update_window_style(p_window);
|
|
} break;
|
|
} break;
|
|
|
|
+ case WINDOW_FLAG_SHARP_CORNERS: {
|
|
|
|
+ wd.sharp_corners = p_enabled;
|
|
|
|
+ DWORD value = wd.sharp_corners ? DWMWCP_DONOTROUND : DWMWCP_DEFAULT;
|
|
|
|
+ ::DwmSetWindowAttribute(wd.hWnd, DWMWA_WINDOW_CORNER_PREFERENCE, &value, sizeof(value));
|
|
|
|
+ _update_window_style(p_window);
|
|
|
|
+ } break;
|
|
case WINDOW_FLAG_TRANSPARENT: {
|
|
case WINDOW_FLAG_TRANSPARENT: {
|
|
if (p_enabled) {
|
|
if (p_enabled) {
|
|
// Enable per-pixel alpha.
|
|
// Enable per-pixel alpha.
|
|
@@ -3994,6 +4015,10 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
|
|
native_menu->_menu_activate(HMENU(lParam), (int)wParam);
|
|
native_menu->_menu_activate(HMENU(lParam), (int)wParam);
|
|
} break;
|
|
} break;
|
|
case WM_CREATE: {
|
|
case WM_CREATE: {
|
|
|
|
+ {
|
|
|
|
+ DWORD value = windows[window_id].sharp_corners ? DWMWCP_DONOTROUND : DWMWCP_DEFAULT;
|
|
|
|
+ ::DwmSetWindowAttribute(windows[window_id].hWnd, DWMWA_WINDOW_CORNER_PREFERENCE, &value, sizeof(value));
|
|
|
|
+ }
|
|
if (is_dark_mode_supported() && dark_title_available) {
|
|
if (is_dark_mode_supported() && dark_title_available) {
|
|
BOOL value = is_dark_mode();
|
|
BOOL value = is_dark_mode();
|
|
|
|
|
|
@@ -5645,6 +5670,12 @@ DisplayServer::WindowID DisplayServerWindows::_create_window(WindowMode p_mode,
|
|
wd_transient_parent->transient_children.insert(id);
|
|
wd_transient_parent->transient_children.insert(id);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ wd.sharp_corners = p_flags & WINDOW_FLAG_SHARP_CORNERS_BIT;
|
|
|
|
+ {
|
|
|
|
+ DWORD value = wd.sharp_corners ? DWMWCP_DONOTROUND : DWMWCP_DEFAULT;
|
|
|
|
+ ::DwmSetWindowAttribute(wd.hWnd, DWMWA_WINDOW_CORNER_PREFERENCE, &value, sizeof(value));
|
|
|
|
+ }
|
|
|
|
+
|
|
if (is_dark_mode_supported() && dark_title_available) {
|
|
if (is_dark_mode_supported() && dark_title_available) {
|
|
BOOL value = is_dark_mode();
|
|
BOOL value = is_dark_mode();
|
|
::DwmSetWindowAttribute(wd.hWnd, use_legacy_dark_mode_before_20H1 ? DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 : DWMWA_USE_IMMERSIVE_DARK_MODE, &value, sizeof(value));
|
|
::DwmSetWindowAttribute(wd.hWnd, use_legacy_dark_mode_before_20H1 ? DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 : DWMWA_USE_IMMERSIVE_DARK_MODE, &value, sizeof(value));
|