summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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;