Browse Source

Disable Win32 clipboard and IME functions when build target UWP (#2892, #2895)

Tracy Ma 5 years ago
parent
commit
8f40020ca6
2 changed files with 5 additions and 0 deletions
  1. 1 0
      docs/CHANGELOG.txt
  2. 4 0
      imgui.cpp

+ 1 - 0
docs/CHANGELOG.txt

@@ -77,6 +77,7 @@ Other Changes:
 - Error handling: Assert if user mistakenly calls End() instead of EndChild() on a child window. (#1651)
 - Misc: Optimized storage of window settings data (reducing allocation count).
 - Misc: Windows: Do not use _wfopen() if IMGUI_DISABLE_WIN32_FUNCTIONS is defined. (#2815)
+- Misc: Windows: Disabled win32 function by default when building with UWP. (#2892, #2895)
 - Misc: Using static_assert() when using C++11, instead of our own construct (avoid zealous Clang warnings).
 - Docs: Improved and moved FAQ to docs/FAQ.md so it can be readable on the web. [@ButternCream, @ocornut]
 - Docs: Added permanent redirect from https://www.dearimgui.org/faq to FAQ page.

+ 4 - 0
imgui.cpp

@@ -9483,6 +9483,10 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl
 #else
 #include <windows.h>
 #endif
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) // UWP doesn't have Win32 functions
+#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS
+#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS
+#endif
 #elif defined(__APPLE__)
 #include <TargetConditionals.h>
 #endif