summaryrefslogtreecommitdiff
path: root/src/Fl_cocoa.mm
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-03-24 22:26:13 +0000
committerManolo Gouy <Manolo>2016-03-24 22:26:13 +0000
commit2530120d7d084f1ffbb9331e925153a3bcb15b92 (patch)
treed71449ebeda1310ea0dddafbc4755db7cd047d27 /src/Fl_cocoa.mm
parentf432c171129fc3657f50073adf87ed99276cb173 (diff)
Rewrite Fl::handle_(int e, Fl_Window* window) and Fl_Widget::damage() to remove their platform dependent parts
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11419 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_cocoa.mm')
-rw-r--r--src/Fl_cocoa.mm13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 3806a2e52..1762c17f5 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -1139,6 +1139,19 @@ static void cocoaMouseHandler(NSEvent *theEvent)
}
mods_to_e_state( mods );
update_e_xy_and_e_xy_root([theEvent window]);
+ if (fl_mac_os_version < 100500) {
+ // before 10.5, mouse moved events aren't sent to borderless windows such as tooltips
+ Fl_Window *tooltip = Fl_Tooltip::current_window();
+ int inside = 0;
+ if (tooltip && tooltip->shown() ) { // check if a tooltip window is currently opened
+ // check if mouse is inside the tooltip
+ inside = (Fl::event_x_root() >= tooltip->x() && Fl::event_x_root() < tooltip->x() + tooltip->w() &&
+ Fl::event_y_root() >= tooltip->y() && Fl::event_y_root() < tooltip->y() + tooltip->h() );
+ }
+ // if inside, send event to tooltip window instead of background window
+ if (inside)
+ window = tooltip;
+ }
Fl::handle( sendEvent, window );
}
break;