diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 8666a252f..79ef1180d 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -614,6 +614,7 @@ static void do_timer(CFRunLoopTimerRef timer, void* data) - (BOOL)windowShouldClose:(FLWindow *)w; - (BOOL)containsGLsubwindow; - (void)setContainsGLsubwindow:(BOOL)contains; +- (BOOL)canBecomeKeyWindow; @end @implementation FLWindow @@ -650,6 +651,16 @@ static void do_timer(CFRunLoopTimerRef timer, void* data) { containsGLsubwindow = contains; } +- (BOOL)canBecomeKeyWindow +{ + // before 10.5, the default impl of canBecomeKeyWindow is not OK for tooltip windows + // we return YES for these windows + BOOL retval; + Fl_Window *flw = (Fl_Window*)[self getFl_Window]; + if(fl_mac_os_version < 0x1050 && flw->tooltip_window()) retval = YES; + else retval = [super canBecomeKeyWindow]; + return retval; +} @end /*