Author: manolo Date: 2013-01-10 00:57:19 -0800 (Thu, 10 Jan 2013) New Revision: 9790 Log: About the fix for a problem apparent with the "cube" test program: if the cube window is moved around rapidly, the GL pixels leak away from where they should be. This problem no longer occurs with Mac OS 10.7 and above. The fix is thus made effective only when OS < 10.7.
Modified: branches/branch-1.3/src/Fl_cocoa.mm Modified: branches/branch-1.3/src/Fl_cocoa.mm =================================================================== --- branches/branch-1.3/src/Fl_cocoa.mm 2013-01-09 09:03:47 UTC (rev 9789) +++ branches/branch-1.3/src/Fl_cocoa.mm 2013-01-10 08:57:19 UTC (rev 9790) @@ -629,8 +629,13 @@ contentRect:(NSRect)rect styleMask:(NSUInteger)windowStyle; - (Fl_Window *)getFl_Window; +/* These two functions allow to check if a window contains OpenGL-subwindows. + This is useful only for Mac OS < 10.7 to repair a problem apparent with the "cube" test program: + if the cube window is moved around rapidly (with OS < 10.7), the GL pixels leak away from where they should be. + The repair is performed by [FLWindowDelegate windowDidMove:], only if OS < 10.7. + */ - (BOOL)containsGLsubwindow; -- (void)setContainsGLsubwindow:(BOOL)contains; +- (void)containsGLsubwindow:(BOOL)contains; @end @implementation FLWindow @@ -653,7 +658,7 @@ { return containsGLsubwindow; } -- (void)setContainsGLsubwindow:(BOOL)contains +- (void)containsGLsubwindow:(BOOL)contains { containsGLsubwindow = contains; } @@ -1030,8 +1035,8 @@ update_e_xy_and_e_xy_root(nsw); resize_from_system = window; window->position((int)pt2.x, (int)(main_screen_height - pt2.y)); - if ([nsw containsGLsubwindow] ) { - [nsw display];// redraw window after moving if it contains OpenGL subwindows + if ([nsw containsGLsubwindow] && fl_mac_os_version < 100700) { + [nsw display];// with OS < 10.7, redraw window after moving if it contains OpenGL subwindows } fl_unlock_function(); } @@ -2123,7 +2128,7 @@ } if (w->as_gl_window()) { // if creating a sub-GL-window while (win->window()) win = win->window(); - [Fl_X::i(win)->xid setContainsGLsubwindow:YES]; + [Fl_X::i(win)->xid containsGLsubwindow:YES]; } fl_show_iconic = 0; } _______________________________________________ fltk-commit mailing list fltk-commit@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-commit