On 28 Oct 2008, at 19:46, Roman Kantor wrote:

> Hi,
>
> I have an Fl_GL_Window where I need to override the handle() and test
> for FL_ENTER and FL_LEAVE events.
> However I am getting a lot of dummy FL_LEAVE events for which I need
> extra testing if the mouse *really* leaves the window.
> Even more the Fl::event_inside(this), Fl::event_x(), Fl::event_y()  
> give
> me inconsistent results an I have to make a workaround and use  
> something
> like:
>
> case FL_LEAVE:{
>    int X = Fl::event_x_root() - top_window->x() - x();
>    int Y = Fl::event_y_root() - top_window->y() - y();
>    if(X<0 || X>w() || Y<0 || Y>h()){
>       ... // really leaving
>    }else{
>       ... // not really leaving
>    }
> }
>

Odd - there was a vaguely related post recently about problems with  
enter/leave on fltk-2, and I had done a little test to see how it  
behaved (fltk-2 seems to be suspect, fltk-1.1.x and 1.3.x seemed fine.)
Anyway, the thread is... here:

http://www.fltk.org/newsgroups.php?gfltk.general+v:26622

I just ran my test again, with a few printf's added to report the  
enter/leave events and they seem to be consistently matched - I don't  
seem to be seeing any extra leave events.

How does my simple demo work for you? Maybe the problem is platform  
specific (I've got OSX and Vista here just now, seem to be fine.)
-- 
Ian




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

Reply via email to