1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-11 00:04:24 +00:00

Backends: OSX: Fixed multi-viewport handling broken in 1.92.0. (#8644, #8777)

This commit is contained in:
ocornut 2025-07-08 13:38:37 +02:00
parent 92e2df5978
commit ee8fd5325a
2 changed files with 4 additions and 9 deletions

View file

@ -34,6 +34,7 @@
// CHANGELOG // CHANGELOG
// (minor and older changes stripped away, please see git history for details) // (minor and older changes stripped away, please see git history for details)
// 2025-XX-XX: Added support for multiple windows via the ImGuiPlatformIO interface. // 2025-XX-XX: Added support for multiple windows via the ImGuiPlatformIO interface.
// 2025-07-08: [Docking] Fixed multi-viewport handling broken on 2025-06-02. (#8644, #8777)
// 2025-06-27: Added ImGuiMouseCursor_Wait and ImGuiMouseCursor_Progress mouse cursor support. // 2025-06-27: Added ImGuiMouseCursor_Wait and ImGuiMouseCursor_Progress mouse cursor support.
// 2025-06-12: ImGui_ImplOSX_HandleEvent() only process event for window containing our view. (#8644) // 2025-06-12: ImGui_ImplOSX_HandleEvent() only process event for window containing our view. (#8644)
// 2025-05-15: [Docking] Add Platform_GetWindowFramebufferScale() handler, to allow varying Retina display density on multiple monitors. // 2025-05-15: [Docking] Add Platform_GetWindowFramebufferScale() handler, to allow varying Retina display density on multiple monitors.
@ -701,12 +702,7 @@ static ImGuiMouseSource GetMouseSource(NSEvent* event)
static bool ImGui_ImplOSX_HandleEvent(NSEvent* event, NSView* view) static bool ImGui_ImplOSX_HandleEvent(NSEvent* event, NSView* view)
{ {
// Only process events from the window containing ImGui view // Only process events from the window containing ImGui view
void* event_handle = (__bridge void*)(event.window); if (!ImGui::FindViewportByPlatformHandle((__bridge void*)event.window))
void* view_handle = (__bridge void*)(view.window);
if (event_handle == nullptr || view_handle == nullptr)
return false;
ImGuiViewport* viewport = ImGui::FindViewportByPlatformHandle(view_handle);
if (viewport == nullptr || viewport->PlatformHandleRaw != event_handle)
return false; return false;
ImGuiIO& io = ImGui::GetIO(); ImGuiIO& io = ImGui::GetIO();
@ -951,9 +947,6 @@ static void ImGui_ImplOSX_CreateWindow(ImGuiViewport* viewport)
static void ImGui_ImplOSX_DestroyWindow(ImGuiViewport* viewport) static void ImGui_ImplOSX_DestroyWindow(ImGuiViewport* viewport)
{ {
NSWindow* window = (__bridge_transfer NSWindow*)viewport->PlatformHandleRaw;
window = nil;
if (ImGui_ImplOSX_ViewportData* vd = (ImGui_ImplOSX_ViewportData*)viewport->PlatformUserData) if (ImGui_ImplOSX_ViewportData* vd = (ImGui_ImplOSX_ViewportData*)viewport->PlatformUserData)
{ {
NSWindow* window = vd->Window; NSWindow* window = vd->Window;

View file

@ -63,6 +63,8 @@ Other changes:
Docking+Viewports Branch: Docking+Viewports Branch:
- Backends: OSX: Fixed multi-viewport handling broken in 1.92.0. (#8644, #8777) [@cfillion]
----------------------------------------------------------------------- -----------------------------------------------------------------------
VERSION 1.92.0 (Released 2025-06-25) VERSION 1.92.0 (Released 2025-06-25)