From 76b185b33e89ab3db5c404f32dd62879ab17a8c4 Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Tue, 14 May 2002 15:24:03 +0000 Subject: Clicking on tooltips makes them go away and they don't reappear. Tooltips do not appear when widgets are entered for reasons other than the mouse moving (ie like when an overlaying window disappears) Possible fix for WIN32 titlebar color when tooltip is instantly displayed for a new widget (untested). Recursion problem in DnD fixed (caused a drag inside the same program to paste many times into where you dropped). Tested only on X but this bug may be X-only. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2220 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Tooltip.cxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/Fl_Tooltip.cxx') diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx index 2597d050e..f0ed3a17b 100644 --- a/src/Fl_Tooltip.cxx +++ b/src/Fl_Tooltip.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Tooltip.cxx,v 1.38.2.20 2002/05/13 17:23:10 easysw Exp $" +// "$Id: Fl_Tooltip.cxx,v 1.38.2.21 2002/05/14 15:24:03 spitzak Exp $" // // Tooltip source file for the Fast Light Tool Kit (FLTK). // @@ -133,7 +133,6 @@ static void tt_enter(Fl_Widget* widget) { // printf("tt_enter(widget=%p)\n", widget); // printf(" window=%p\n", window); - // find the enclosing group with a tooltip: Fl_Widget* w = widget; while (w && !w->tooltip()) { @@ -164,6 +163,11 @@ Fl_Tooltip::enter_area(Fl_Widget* wid, int x,int y,int w,int h, const char* t) widget = wid; X = x; Y = y; W = w; H = h; tip = t; if (recent_tooltip || Fl_Tooltip::delay() < .1) { // switch directly from a previous tooltip to the new one: +#ifdef WIN32 + // possible fix for the Windows titlebar, it seems to want the + // window to be destroyed, moving it messes up the parenting: + if (window) window->hide(); +#endif tooltip_timeout(0); } else { if (window) window->hide(); @@ -173,7 +177,12 @@ Fl_Tooltip::enter_area(Fl_Widget* wid, int x,int y,int w,int h, const char* t) tip = 0; widget = 0; if (window) window->hide(); - if (recent_tooltip) Fl::add_timeout(.2, recent_timeout); + if (recent_tooltip) { + if (Fl::event_state() & 0x7f00000 /*FL_BUTTONS*/) + recent_tooltip = 0; + else + Fl::add_timeout(.2, recent_timeout); + } } // printf(" tip=\"%s\", window->shown()=%d\n", tip ? tip : "(null)", @@ -191,5 +200,5 @@ void Fl_Widget::tooltip(const char *tt) { } // -// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.20 2002/05/13 17:23:10 easysw Exp $". +// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.21 2002/05/14 15:24:03 spitzak Exp $". // -- cgit v1.2.3