mirror of
https://github.com/ocornut/imgui.git
synced 2025-02-07 14:51:22 +01:00
Backends: OSX: Fixed IME position in multi-monitor/multi-viewports setups. (#7028)
This commit is contained in:
parent
a683033e49
commit
8deb1007cd
@ -141,12 +141,28 @@ static bool ImGui_ImplOSX_HandleEvent(NSEvent* event, NSView* view);
|
|||||||
|
|
||||||
- (void)updateImePosWithView:(NSView *)view
|
- (void)updateImePosWithView:(NSView *)view
|
||||||
{
|
{
|
||||||
NSWindow *window = view.window;
|
NSWindow* window = view.window;
|
||||||
if (!window)
|
if (!window)
|
||||||
return;
|
return;
|
||||||
NSRect contentRect = [window contentRectForFrameRect:window.frame];
|
|
||||||
NSRect rect = NSMakeRect(_posX, contentRect.size.height - _posY, 0, 0);
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
_imeRect = [window convertRectToScreen:rect];
|
if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
|
||||||
|
{
|
||||||
|
NSRect frame = window.frame;
|
||||||
|
NSRect contentRect = window.contentLayoutRect;
|
||||||
|
if (window.styleMask & NSWindowStyleMaskFullSizeContentView) // No title bar windows should be considered.
|
||||||
|
contentRect = frame;
|
||||||
|
|
||||||
|
NSRect firstScreenFrame = NSScreen.screens[0].frame;
|
||||||
|
_imeRect = NSMakeRect(_posX, _posY, 0, 0);
|
||||||
|
_imeRect.origin.y = firstScreenFrame.size.height - _imeRect.size.height - _imeRect.origin.y; // Opposite of ConvertNSRect()
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSRect contentRect = [window contentRectForFrameRect:window.frame];
|
||||||
|
NSRect rect = NSMakeRect(_posX, contentRect.size.height - _posY, 0, 0);
|
||||||
|
_imeRect = [window convertRectToScreen:rect];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidMoveToWindow
|
- (void)viewDidMoveToWindow
|
||||||
|
@ -115,6 +115,7 @@ Docking+Viewports Branch:
|
|||||||
queued frames aren't synchronized with platform window resizes. (#7152, #7153) [@SuperWangKai]
|
queued frames aren't synchronized with platform window resizes. (#7152, #7153) [@SuperWangKai]
|
||||||
- Backends: OSX: Fixed monitor and window position by correctly transforming Y origin on multi-viewports
|
- Backends: OSX: Fixed monitor and window position by correctly transforming Y origin on multi-viewports
|
||||||
multi-monitor setups. (#7028, #7101, #6009, #6432) [@dmirty-kuzmenko, @734vin]
|
multi-monitor setups. (#7028, #7101, #6009, #6432) [@dmirty-kuzmenko, @734vin]
|
||||||
|
- Backends: OSX: Fixed IME position in multi-monitor multi-viewports setups. (#7028) [@734vin]
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user