Tell cocoa the previous character range is invalid when updating IME position
Without this IME popup position is sometimes incorrect, for instance, at startup
This commit is contained in:
parent
5e78b1c23e
commit
acdf06bf5d
@ -1505,12 +1505,13 @@ void _glfwPlatformUpdateIMEState(_GLFWwindow *w, const GLFWIMEUpdateEvent *ev) {
|
|||||||
top /= window->ns.yscale;
|
top /= window->ns.yscale;
|
||||||
cellWidth /= window->ns.xscale;
|
cellWidth /= window->ns.xscale;
|
||||||
cellHeight /= window->ns.yscale;
|
cellHeight /= window->ns.yscale;
|
||||||
debug_key("updateIMEState: left=%f, top=%f, width=%f, height=%f\n", left, top, cellWidth, cellHeight);
|
debug_key("updateIMEPosition: left=%f, top=%f, width=%f, height=%f\n", left, top, cellWidth, cellHeight);
|
||||||
const NSRect frame = [window->ns.view frame];
|
const NSRect frame = [window->ns.view frame];
|
||||||
const NSRect rectInView = NSMakeRect(left,
|
const NSRect rectInView = NSMakeRect(left,
|
||||||
frame.size.height - top - cellHeight,
|
frame.size.height - top - cellHeight,
|
||||||
cellWidth, cellHeight);
|
cellWidth, cellHeight);
|
||||||
markedRect = [window->ns.object convertRectToScreen: rectInView];
|
markedRect = [window->ns.object convertRectToScreen: rectInView];
|
||||||
|
if (_glfwPlatformWindowFocused(window)) [[window->ns.view inputContext] invalidateCharacterCoordinates];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray*)validAttributesForMarkedText
|
- (NSArray*)validAttributesForMarkedText
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user