DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2775
Version: 1.3-current
The current OS X Fl_Window::resize() method assumes that the system will
respect the resize and move operations given to it. Unfortunately that
isn't always the case. One example is trying to resize the window to
something larger than the screen, which the system will then crop.
When this assumption fails, FLTK and the system get out of sync as to the
window's dimensions and things break in fun and interesting ways.
I've played around with it and determined that the system will send events
back to the application with the size and position it deemed suitable. So
the code should be changed to treat setFrame and setFrameOrigin as
requests, and then wait for the system to act on them. The attached patch
does just that.
Link: http://www.fltk.org/str.php?L2775
Version: 1.3-current
diff -up fltk-1.3.0/src/Fl_cocoa.mm.orig fltk-1.3.0/src/Fl_cocoa.mm
--- fltk-1.3.0/src/Fl_cocoa.mm.orig 2011-11-21 14:01:46.654077147 +0100
+++ fltk-1.3.0/src/Fl_cocoa.mm 2011-11-21 14:01:48.025083631 +0100
@@ -2600,6 +2600,12 @@ void Fl_Window::resize(int X,int Y,int W
pt.y = [[(NSWindow*)i->xid screen] frame].size.height - (Y + h());
[(NSWindow*)i->xid setFrameOrigin:pt];
}
+ // setFrame and setFrameOrigin are only requests to the system to
+ // do a resize or move. We will get callbacks later if the system allowed
+ // this, and possibly with adjusted values. We avoid processing until
+ // that happens (which usually happens directly as setFrame[Origin] is
+ // called).
+ return;
}
resize_from_system = 0;
if (is_a_resize) {
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs