summaryrefslogtreecommitdiff
path: root/src/Fl.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2010-12-01 23:12:06 +0000
committerManolo Gouy <Manolo>2010-12-01 23:12:06 +0000
commit17963c0475565be7019d73e3fc68cb8ee089e198 (patch)
treeba088d52babd54b0e9b6da859522a09edefb2e52 /src/Fl.cxx
parent2f8b7e47c2e3b2e3ecabd0711e8daf735f32f09d (diff)
Fix STR #2462.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7935 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl.cxx')
-rw-r--r--src/Fl.cxx22
1 files changed, 19 insertions, 3 deletions
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