From 2530120d7d084f1ffbb9331e925153a3bcb15b92 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Thu, 24 Mar 2016 22:26:13 +0000 Subject: 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 --- src/Fl_cocoa.mm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Fl_cocoa.mm') 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; -- cgit v1.2.3