summaryrefslogtreecommitdiff
path: root/src/Fl_cocoa.mm
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2025-05-21 08:08:18 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2025-05-21 08:08:18 +0200
commit7347d6e2f66cac9215ccef72f8e7c565597b77fd (patch)
treee86c1adc6d095c8919b95f4ed0c691b4c6ba9b5d /src/Fl_cocoa.mm
parent0960f1c066ad6a94754a081c5b54f34fee4b67f6 (diff)
Add change necessary to support new class Fl_Native_Input, possibly as addon
The added if() statement's condition is always false in FLTK before addition to it of class Fl_Native_Input. Therefore, the present modification is effectless unless this new class is added to the library, either in its core or as an addon.
Diffstat (limited to 'src/Fl_cocoa.mm')
-rw-r--r--src/Fl_cocoa.mm8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 19aa86791..7ad18feb4 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -2514,6 +2514,14 @@ static FLTextInputContext* fltextinputcontext_instance = nil;
- (BOOL)performKeyEquivalent:(NSEvent*)theEvent
{
//NSLog(@"performKeyEquivalent:");
+ /* The condition below is always false (and therefore the return statement doesn't run)
+ for the FLTK library unless it contains class Fl_Native_Input with which FLTK windows
+ may contain subviews inside their contentView. When such subview has focus, the condition
+ below becomes true.
+ */
+ if ([[self window] firstResponder] != self) {
+ return NO;
+ }
fl_lock_function();
cocoaKeyboardHandler(theEvent);
BOOL handled;