Viewports: Backported 'void* ImGuiViewport::PlatformHandle' from docking branch for use by backends.

This commit is contained in:
ocornut
2024-06-26 14:32:48 +02:00
parent eb1cc4b8b4
commit 32f9dfc126
7 changed files with 27 additions and 19 deletions
+3 -1
View File
@@ -133,7 +133,7 @@ static bool ImGui_ImplOSX_HandleEvent(NSEvent* event, NSView* view);
- (void)updateImePosWithView:(NSView *)view
{
NSWindow *window = view.window;
NSWindow* window = view.window;
if (!window)
return;
NSRect contentRect = [window contentRectForFrameRect:window.frame];
@@ -402,6 +402,8 @@ bool ImGui_ImplOSX_Init(NSView* view)
//io.BackendFlags |= ImGuiBackendFlags_HasSetMousePos; // We can honor io.WantSetMousePos requests (optional, rarely used)
bd->Observer = [ImGuiObserver new];
ImGuiViewport* main_viewport = ImGui::GetMainViewport();
main_viewport->PlatformHandle = main_viewport->PlatformHandleRaw = (__bridge_retained void*)bd->Window;
// Load cursors. Some of them are undocumented.
bd->MouseCursorHidden = false;