DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2309
Version: 1.1.10
Like the summary says. You can demonstrate it by printing
'Fl::event_x_root() - Fl::event_x()' from the resize of a window, and then
dragging it around.
Here's a patch relative to release-1.1.10 that fixes it. All of the misc
places where those four globals are set should probably be put into a
single function, but it's probably not worth it for the old carbon
backend.
I noticed Fl_cocoa.mm has the same problem. I haven't checked other OSes,
so I'm not sure if they do the same thing.
Link: http://www.fltk.org/str.php?L2309
Version: 1.1.10
Index: src/Fl_mac.cxx
===================================================================
--- src/Fl_mac.cxx (revision 7022)
+++ src/Fl_mac.cxx (working copy)
@@ -885,6 +885,22 @@
break;
}
+ // Set xy root when the window changes position or a new window is focused.
+ switch ( kind )
+ {
+ case kEventWindowBoundsChanging:
+ case kEventWindowActivated:
+ case kEventWindowShown:
+ Point pos;
+ GetEventParameter( event, kEventParamMouseLocation, typeQDPoint, NULL,
sizeo
+f(Point), NULL, &pos );
+ Fl::e_x_root = pos.h;
+ Fl::e_y_root = pos.v;
+ GlobalToLocal( &pos );
+ Fl::e_x = pos.h;
+ Fl::e_y = pos.v;
+ }
+
fl_unlock_function();
return ret;
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs