From d666a6f234465e913248b5f02fe05862d468ae92 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sun, 28 Oct 2018 14:20:44 +0000 Subject: 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 --- src/Fl_cocoa.mm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index bd8f25715..98fa750c0 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2196,16 +2196,9 @@ 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); - through_drawRect = YES; - window->clear_damage(FL_DAMAGE_ALL); - window->as_gl_window()->flush(); - window->clear_damage(); - through_drawRect = NO; - 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 + [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. @@ -2213,6 +2206,14 @@ static CGContextRef prepare_bitmap_for_layer(int w, int h ) { [[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(); + window->clear_damage(); + through_drawRect = NO; + if (fl_mac_os_version < 101401) { + if (window->parent()) window->redraw(); // useful during resize of GL subwindow + } fl_unlock_function(); } -(void)viewFrameDidChange { ; } -- cgit v1.2.3