It appears that adding "case FL_LEAVE:" right after the FL_ENTER case  
in Fl_Group::handle() fixes this. The default case probably shouldn't  
be used for any mouse/position events since it doesn't check for  
position.

Index: src/Fl_Group.cxx
===================================================================
--- src/Fl_Group.cxx    (revision 6916)
+++ src/Fl_Group.cxx    (working copy)
@@ -192,6 +192,7 @@
      return 0;

    case FL_ENTER:
+  case FL_LEAVE:
    case FL_MOVE:
      for (i = children(); i--;) {
        o = a[i];



On Oct 21, 2009, at 12:42 PM, Harvey Chapman wrote:

> fltk-1.3.x-r6916
>
> I have a window with only one active item, a button (not counting
> three active, but empty groups). When the mouse leaves the entire
> window, I get a FL_LEAVE event over and over again, i.e. each time the
> mouse leaves the entire window. It doesn't hurt anything, but it
> doesn't seem correct either since the mouse never FL_ENTERed the
> button to begin with.
>
> Here's a fluid file to demonstrate the behavior.
>
> Harvey
>
>
> # data file for the Fltk User Interface Designer (fluid)
> version 1.0300
> header_name {.h}
> code_name {.cxx}
> decl {\#include <FL/Enumerations.H>} {selected
> }
>
> Function {fl_event_name(enum Fl_Event event)} {open selected
> return_type {static const char *}
> } {
>   code {switch (event)
>   {
> \#define PEVENT(_E) case _E: return(\#_E)
>     PEVENT(FL_NO_EVENT);
>     PEVENT(FL_PUSH);
>     PEVENT(FL_RELEASE);
>     PEVENT(FL_ENTER);
>     PEVENT(FL_LEAVE);
>     PEVENT(FL_DRAG);
>     PEVENT(FL_FOCUS);
>     PEVENT(FL_UNFOCUS);
>     PEVENT(FL_KEYDOWN);
>     //PEVENT(FL_KEYBOARD);
>     PEVENT(FL_KEYUP);
>     PEVENT(FL_CLOSE);
>     PEVENT(FL_MOVE);
>     PEVENT(FL_SHORTCUT);
>     PEVENT(FL_DEACTIVATE);
>     PEVENT(FL_ACTIVATE);
>     PEVENT(FL_HIDE);
>     PEVENT(FL_SHOW);
>     PEVENT(FL_PASTE);
>     PEVENT(FL_SELECTIONCLEAR);
>     PEVENT(FL_MOUSEWHEEL);
>     PEVENT(FL_DND_ENTER);
>     PEVENT(FL_DND_DRAG);
>     PEVENT(FL_DND_LEAVE);
>     PEVENT(FL_DND_RELEASE);
> \#undef PEVENT
>   }
>
>   return("unknown");} {}
> }
>
> Function {} {open
> } {
>   Fl_Window {} {open
>     xywh {579 249 570 360} type Double visible
>   } {
>     Fl_Button {} {
>       label button
>       xywh {215 25 130 25}
>       class MyButton
>     }
>   }
> }
>
> widget_class MyButton {open
>   xywh {694 75 100 100} type Double
>   class Fl_Button visible
> } {
>   Function {end()} {} {
>     code {} {}
>   }
>   Function {handle(int event)} {open return_type int
>   } {
>     code {printf("%-20s: %d: %-20s\\n", nameof(this), event,
> fl_event_name((Fl_Event)event));
>   return Fl_Button::handle(event);} {}
>   }
>   Function {nameof(Fl_Widget *o)} {open return_type {const char *}
>   } {
>     code {if (!o) return "NULL";
>   if (!o->label()) return "<no label>";
>   return o->label();} {}
>   }
> }
>
>
> _______________________________________________
> fltk mailing list
> [email protected]
> http://lists.easysw.com/mailman/listinfo/fltk

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to