|
@@ -31,6 +31,7 @@
|
|
|
// CHANGELOG
|
|
|
// (minor and older changes stripped away, please see git history for details)
|
|
|
// 2025-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
|
|
|
+// 2025-04-26: Disable multi-viewports under Wayland. (#8587)
|
|
|
// 2025-03-10: Map GLFW_KEY_WORLD_1 and GLFW_KEY_WORLD_2 into ImGuiKey_Oem102.
|
|
|
// 2025-03-03: Fixed clipboard handler assertion when using GLFW <= 3.2.1 compiled with asserts enabled.
|
|
|
// 2025-02-21: [Docking] Update monitors and work areas information every frame, as the later may change regardless of monitor changes. (#8415)
|
|
@@ -162,6 +163,7 @@
|
|
|
#define GLFW_HAS_GAMEPAD_API (GLFW_VERSION_COMBINED >= 3300) // 3.3+ glfwGetGamepadState() new api
|
|
|
#define GLFW_HAS_GETKEYNAME (GLFW_VERSION_COMBINED >= 3200) // 3.2+ glfwGetKeyName()
|
|
|
#define GLFW_HAS_GETERROR (GLFW_VERSION_COMBINED >= 3300) // 3.3+ glfwGetError()
|
|
|
+#define GLFW_HAS_GETPLATFORM (GLFW_VERSION_COMBINED >= 3400) // 3.4+ glfwGetPlatform()
|
|
|
|
|
|
// GLFW data
|
|
|
enum GlfwClientApi
|
|
@@ -622,8 +624,16 @@ static bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks, Glfw
|
|
|
io.BackendPlatformName = "imgui_impl_glfw";
|
|
|
io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors; // We can honor GetMouseCursor() values (optional)
|
|
|
io.BackendFlags |= ImGuiBackendFlags_HasSetMousePos; // We can honor io.WantSetMousePos requests (optional, rarely used)
|
|
|
+
|
|
|
+ bool has_viewports = false;
|
|
|
#ifndef __EMSCRIPTEN__
|
|
|
- io.BackendFlags |= ImGuiBackendFlags_PlatformHasViewports; // We can create multi-viewports on the Platform side (optional)
|
|
|
+ has_viewports = true;
|
|
|
+#if GLFW_HAS_GETPLATFORM
|
|
|
+ if (glfwGetPlatform() == GLFW_PLATFORM_WAYLAND)
|
|
|
+ has_viewports = false;
|
|
|
+#endif
|
|
|
+ if (has_viewports)
|
|
|
+ io.BackendFlags |= ImGuiBackendFlags_PlatformHasViewports; // We can create multi-viewports on the Platform side (optional)
|
|
|
#endif
|
|
|
#if GLFW_HAS_MOUSE_PASSTHROUGH || GLFW_HAS_WINDOW_HOVERED
|
|
|
io.BackendFlags |= ImGuiBackendFlags_HasMouseHoveredViewport; // We can call io.AddMouseViewportEvent() with correct data (optional)
|
|
@@ -690,7 +700,8 @@ static bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks, Glfw
|
|
|
#else
|
|
|
IM_UNUSED(main_viewport);
|
|
|
#endif
|
|
|
- ImGui_ImplGlfw_InitMultiViewportSupport();
|
|
|
+ if (has_viewports)
|
|
|
+ ImGui_ImplGlfw_InitMultiViewportSupport();
|
|
|
|
|
|
// Windows: register a WndProc hook so we can intercept some messages.
|
|
|
#ifdef _WIN32
|