MacOS Mojave 10.14 support: fix creation of several OpenGL windows.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13086 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2018-10-28 14:20:44 +00:00
parent 50f90a6970
commit d666a6f234

View File

@ -2196,6 +2196,16 @@ static CGContextRef prepare_bitmap_for_layer(int w, int h ) {
if (!Fl::use_high_res_GL() && fl_mac_os_version < 101401) [self layer].contentsScale = 1.;
Fl_Window *window = [(FLWindow*)[self window] getFl_Window];
Fl_Cocoa_Window_Driver *d = Fl_Cocoa_Window_Driver::driver(window);
if (d->wait_for_expose_value) {
// 1st drawing of GL window
[self did_view_resolution_change];
NSRect r = [[self window] frame];
r.size.width -= 1;
[[self window] setFrame:r display:NO]; // very dirty but works. Should find something better.
r.size.width += 1;
[[self window] setFrame:r display:YES];
d->wait_for_expose_value = 0;
}
through_drawRect = YES;
window->clear_damage(FL_DAMAGE_ALL);
window->as_gl_window()->flush();
@ -2204,15 +2214,6 @@ static CGContextRef prepare_bitmap_for_layer(int w, int h ) {
if (fl_mac_os_version < 101401) {
if (window->parent()) window->redraw(); // useful during resize of GL subwindow
}
if (d->wait_for_expose_value) {
// 1st drawing of GL window
NSRect r = [[self window] frame];
r.size.width -= 1;
[[self window] setFrame:r display:NO]; // very dirty but works. Should find something better.
r.size.width += 1;
[[self window] setFrame:r display:YES];
d->wait_for_expose_value = 0;
}
fl_unlock_function();
}
-(void)viewFrameDidChange { ; }