diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/linuxbsd/display_server_x11.cpp | 37 | ||||
-rw-r--r-- | platform/uwp/detect.py | 3 | ||||
-rw-r--r-- | platform/uwp/export/export.cpp | 2 | ||||
-rw-r--r-- | platform/windows/detect.py | 19 |
4 files changed, 41 insertions, 20 deletions
diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp index 8b0d08d1cb..176878bc12 100644 --- a/platform/linuxbsd/display_server_x11.cpp +++ b/platform/linuxbsd/display_server_x11.cpp @@ -737,6 +737,7 @@ void DisplayServerX11::delete_sub_window(WindowID p_id) { XDestroyWindow(x11_display, wd.x11_window); if (wd.xic) { XDestroyIC(wd.xic); + wd.xic = nullptr; } windows.erase(p_id); @@ -2784,6 +2785,13 @@ void DisplayServerX11::process_events() { wd.focused = true; + if (wd.xic) { + // Block events polling while changing input focus + // because it triggers some event polling internally. + MutexLock mutex_lock(events_mutex); + XSetICFocus(wd.xic); + } + // Keep track of focus order for overlapping windows. static unsigned int focus_order = 0; wd.focus_order = ++focus_order; @@ -2812,12 +2820,6 @@ void DisplayServerX11::process_events() { XIGrabDevice(x11_display, xi.touch_devices[i], x11_window, CurrentTime, None, XIGrabModeAsync, XIGrabModeAsync, False, &xi.touch_event_mask); }*/ #endif - if (wd.xic) { - // Block events polling while changing input focus - // because it triggers some event polling internally. - MutexLock mutex_lock(events_mutex); - XSetICFocus(wd.xic); - } if (!app_focused) { if (OS::get_singleton()->get_main_loop()) { @@ -2834,6 +2836,13 @@ void DisplayServerX11::process_events() { wd.focused = false; + if (wd.xic) { + // Block events polling while changing input focus + // because it triggers some event polling internally. + MutexLock mutex_lock(events_mutex); + XUnsetICFocus(wd.xic); + } + Input::get_singleton()->release_pressed_events(); _send_window_event(wd, WINDOW_EVENT_FOCUS_OUT); @@ -2864,12 +2873,6 @@ void DisplayServerX11::process_events() { } xi.state.clear(); #endif - if (wd.xic) { - // Block events polling while changing input focus - // because it triggers some event polling internally. - MutexLock mutex_lock(events_mutex); - XUnsetICFocus(wd.xic); - } } break; case ConfigureNotify: { @@ -4044,11 +4047,13 @@ DisplayServerX11::~DisplayServerX11() { } #endif - if (E->get().xic) { - XDestroyIC(E->get().xic); + WindowData &wd = E->get(); + if (wd.xic) { + XDestroyIC(wd.xic); + wd.xic = nullptr; } - XUnmapWindow(x11_display, E->get().x11_window); - XDestroyWindow(x11_display, E->get().x11_window); + XUnmapWindow(x11_display, wd.x11_window); + XDestroyWindow(x11_display, wd.x11_window); } //destroy drivers diff --git a/platform/uwp/detect.py b/platform/uwp/detect.py index a7ca26c16c..2af7803749 100644 --- a/platform/uwp/detect.py +++ b/platform/uwp/detect.py @@ -80,6 +80,9 @@ def configure(env): env["ENV"] = os.environ vc_base_path = os.environ["VCTOOLSINSTALLDIR"] if "VCTOOLSINSTALLDIR" in os.environ else os.environ["VCINSTALLDIR"] + # Force to use Unicode encoding + env.AppendUnique(CCFLAGS=["/utf-8"]) + # ANGLE angle_root = os.getenv("ANGLE_SRC_PATH") env.Prepend(CPPPATH=[angle_root + "/include"]) diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index 5679ec3eac..219174b509 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -249,7 +249,7 @@ void AppxPackager::make_content_types(const String &p_path) { Map<String, String> types; for (int i = 0; i < file_metadata.size(); i++) { - String ext = file_metadata[i].name.get_extension(); + String ext = file_metadata[i].name.get_extension().to_lower(); if (types.has(ext)) { continue; diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 6b503c1561..489e45404f 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -65,7 +65,7 @@ def get_opts(): # Vista support dropped after EOL due to GH-10243 ("target_win_version", "Targeted Windows version, >= 0x0601 (Windows 7)", "0x0601"), EnumVariable("debug_symbols", "Add debugging symbols to release builds", "yes", ("yes", "no", "full")), - EnumVariable("windows_subsystem", "Windows subsystem", "gui", ("console", "gui")), + EnumVariable("windows_subsystem", "Windows subsystem", "default", ("default", "console", "gui")), BoolVariable("separate_debug_symbols", "Create a separate file containing debugging symbols", False), ("msvc_version", "MSVC version to use. Ignored if VCINSTALLDIR is set in shell env.", None), BoolVariable("use_mingw", "Use the Mingw compiler, even if MSVC is installed. Only used on Windows.", False), @@ -178,8 +178,15 @@ def configure_msvc(env, manual_msvc_config): """Configure env to work with MSVC""" # Build type + if env["tests"]: env["windows_subsystem"] = "console" + elif env["windows_subsystem"] == "default": + # Default means we use console for debug, gui for release. + if "debug" in env["target"]: + env["windows_subsystem"] = "console" + else: + env["windows_subsystem"] = "gui" if env["target"] == "release": if env["optimize"] == "speed": # optimize for speed (default) @@ -215,8 +222,8 @@ def configure_msvc(env, manual_msvc_config): ## Compile/link flags env.AppendUnique(CCFLAGS=["/MT", "/Gd", "/GR", "/nologo"]) - if int(env["MSVC_VERSION"].split(".")[0]) >= 14: # vs2015 and later - env.AppendUnique(CCFLAGS=["/utf-8"]) + # Force to use Unicode encoding + env.AppendUnique(CCFLAGS=["/utf-8"]) env.AppendUnique(CXXFLAGS=["/TP"]) # assume all sources are C++ if manual_msvc_config: # should be automatic if SCons found it if os.getenv("WindowsSdkDir") is not None: @@ -311,6 +318,12 @@ def configure_mingw(env): if env["tests"]: env["windows_subsystem"] = "console" + elif env["windows_subsystem"] == "default": + # Default means we use console for debug, gui for release. + if "debug" in env["target"]: + env["windows_subsystem"] = "console" + else: + env["windows_subsystem"] = "gui" if env["target"] == "release": env.Append(CCFLAGS=["-msse2"]) |