From 17963c0475565be7019d73e3fc68cb8ee089e198 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 1 Dec 2010 23:12:06 +0000 Subject: Fix STR #2462. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7935 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl.cxx | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/Fl.cxx') diff --git a/src/Fl.cxx b/src/Fl.cxx index 6bd2ef80d..902d09b43 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1042,9 +1042,25 @@ int Fl::handle(int e, Fl_Window* window) } if (modal() && wi != modal()) wi = 0; if (grab()) wi = grab(); - {Fl_Widget* pbm = belowmouse(); - int ret = (wi && send(e, wi, window)); - if (pbm != belowmouse()) { + { int ret; + Fl_Widget* pbm = belowmouse(); +#ifdef __APPLE__ + if (fl_mac_os_version < 0x1050) { + // 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) ret = send(e, tooltip, window); + else ret = (wi && send(e, wi, window)); + } else +#endif + ret = (wi && send(e, wi, window)); + if (pbm != belowmouse()) { #ifdef DEBUG printf("Fl::handle(e=%d, window=%p);\n", e, window); #endif // DEBUG -- cgit v1.2.3