summaryrefslogtreecommitdiffstats
path: root/platform/windows
diff options
context:
space:
mode:
authorGeorge L. Albany <Megacake1234@gmail.com>2024-11-27 21:15:49 +0000
committerGitHub <noreply@github.com>2024-11-27 21:15:49 +0000
commit85d87116e184e7923b8d6804cab2681b61c62d83 (patch)
tree55ec5bfa061a5c27272b831e697b78ed1b756a70 /platform/windows
parentb06d20bf39d15ec736d08d4e4fcb32e0c3c1ce1e (diff)
parent721f53fde47c2727d99e3ecccdb789a67df36de0 (diff)
downloadredot-engine-master.tar.gz
Merge pull request #886 from Spartan322/merge/f128f38HEADmaster
Merge commit godotengine/godot@f128f38
Diffstat (limited to 'platform/windows')
-rw-r--r--platform/windows/display_server_windows.cpp4
-rw-r--r--platform/windows/display_server_windows.h4
-rw-r--r--platform/windows/os_windows.cpp3
3 files changed, 10 insertions, 1 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index 8f27889382..8a0402a7eb 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -2169,6 +2169,10 @@ void DisplayServerWindows::_get_window_style(bool p_main_window, bool p_initiali
r_style |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
r_style_ex |= WS_EX_ACCEPTFILES;
+
+ if (OS::get_singleton()->get_current_rendering_driver_name() == "d3d12") {
+ r_style_ex |= WS_EX_NOREDIRECTIONBITMAP;
+ }
}
void DisplayServerWindows::_update_window_style(WindowID p_window, bool p_repaint) {
diff --git a/platform/windows/display_server_windows.h b/platform/windows/display_server_windows.h
index 020b0a7636..df8ed3412a 100644
--- a/platform/windows/display_server_windows.h
+++ b/platform/windows/display_server_windows.h
@@ -358,6 +358,10 @@ typedef enum _SHC_PROCESS_DPI_AWARENESS {
SHC_PROCESS_PER_MONITOR_DPI_AWARE = 2,
} SHC_PROCESS_DPI_AWARENESS;
+#ifndef WS_EX_NOREDIRECTIONBITMAP
+#define WS_EX_NOREDIRECTIONBITMAP 0x00200000L
+#endif
+
class DropTargetWindows;
class DisplayServerWindows : public DisplayServer {
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index dbd68e56ec..43625b5726 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -1530,7 +1530,8 @@ DWRITE_FONT_STRETCH OS_Windows::_stretch_to_dw(int p_stretch) const {
}
Vector<String> OS_Windows::get_system_font_path_for_text(const String &p_font_name, const String &p_text, const String &p_locale, const String &p_script, int p_weight, int p_stretch, bool p_italic) const {
- if (!dwrite2_init) {
+ // This may be called before TextServerManager has been created, which would cause a crash downstream if we do not check here
+ if (!dwrite2_init || !TextServerManager::get_singleton()) {
return Vector<String>();
}