mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-28 02:30:05 +00:00
NSViewComponentPeer: Avoid processing key events directly during IME composition
This fixes an issue where e.g. pressing 'return' to select an item from an IME list would directly insert a newline character, rather than selecting the entry.
This commit is contained in:
parent
d563fcd7b4
commit
8d6169fbf5
1 changed files with 4 additions and 5 deletions
|
|
@ -1590,7 +1590,7 @@ public:
|
|||
#else
|
||||
bool usingCoreGraphics = false;
|
||||
#endif
|
||||
bool isZooming = false, isFirstLiveResize = false, textWasInserted = false;
|
||||
bool textWasInserted = false, isFirstLiveResize = false;
|
||||
bool isStretchingTop = false, isStretchingLeft = false, isStretchingBottom = false, isStretchingRight = false;
|
||||
bool windowRepresentsFile = false;
|
||||
bool isAlwaysOnTop = false, wasAlwaysOnTop = false;
|
||||
|
|
@ -2007,15 +2007,14 @@ struct JuceNSViewClass : public NSViewComponentPeerWrapper<ObjCClass<NSView>>
|
|||
{
|
||||
if (auto* owner = getOwner (self))
|
||||
{
|
||||
auto* target = owner->findCurrentTextInputTarget();
|
||||
owner->textWasInserted = false;
|
||||
|
||||
if (target != nullptr)
|
||||
if (auto* target = owner->findCurrentTextInputTarget())
|
||||
[(NSView*) self interpretKeyEvents: [NSArray arrayWithObject: ev]];
|
||||
else
|
||||
owner->stringBeingComposed.clear();
|
||||
|
||||
if (! (owner->textWasInserted || owner->redirectKeyDown (ev)))
|
||||
if (! (owner->textWasInserted || owner->stringBeingComposed.isNotEmpty() || owner->redirectKeyDown (ev)))
|
||||
sendSuperclassMessage<void> (self, @selector (keyDown:), ev);
|
||||
}
|
||||
});
|
||||
|
|
@ -2367,7 +2366,7 @@ struct JuceNSWindowClass : public NSViewComponentPeerWrapper<ObjCClass<NSWindo
|
|||
{
|
||||
auto* owner = getOwner (self);
|
||||
|
||||
if (owner == nullptr || owner->isZooming)
|
||||
if (owner == nullptr)
|
||||
return proposedFrameSize;
|
||||
|
||||
NSRect frameRect = flippedScreenRect ([(NSWindow*) self frame]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue