From 5e504783801063d39151d65cd122049311e802a9 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Fri, 28 Jan 2011 17:38:07 +0000 Subject: [PATCH] Fix STR #2541. The code is unchanged for Mac OS and MSWindows because the bug does not occur there. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8325 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Tooltip.cxx | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx index 67d620f94..f91d9dcbc 100644 --- a/src/Fl_Tooltip.cxx +++ b/src/Fl_Tooltip.cxx @@ -132,15 +132,20 @@ static void tooltip_timeout(void*) { if (!tip || !*tip) { if (window) window->hide(); } else { - //if (Fl::grab()) return; - if (!window) window = new Fl_TooltipBox; - // this cast bypasses the normal Fl_Window label() code: - ((Fl_Widget*)window)->label(tip); - window->layout(); - window->redraw(); -// printf("tooltip_timeout: Showing window %p with tooltip \"%s\"...\n", -// window, tip ? tip : "(null)"); - window->show(); + int condition = 1; +#if !(defined(__APPLE__) || defined(WIN32)) + condition = (Fl::grab() == NULL); +#endif + if ( condition ) { + if (!window) window = new Fl_TooltipBox; + // this cast bypasses the normal Fl_Window label() code: + ((Fl_Widget*)window)->label(tip); + window->layout(); + window->redraw(); + // printf("tooltip_timeout: Showing window %p with tooltip \"%s\"...\n", + // window, tip ? tip : "(null)"); + window->show(); + } } Fl::remove_timeout(recent_timeout);