Support for macOS 10.14 Mojave: apps linked with SDK 10.14 did not draw anything in their windows.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13057 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2018-09-27 05:42:57 +00:00
parent 673d95b99c
commit f76d2a2bf8

View File

@ -3223,13 +3223,17 @@ void Fl_Cocoa_Window_Driver::make_current()
destroy_double_buffer();
changed_resolution(false);
}
NSGraphicsContext *nsgc;
/*NSGraphicsContext *nsgc;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
if (fl_mac_os_version >= 100400)
nsgc = [fl_window graphicsContext]; // 10.4
else
#endif
nsgc = through_Fl_X_flush ? [NSGraphicsContext currentContext] : [NSGraphicsContext graphicsContextWithWindow:fl_window];
#endif*/
NSGraphicsContext *nsgc = through_Fl_X_flush ? [NSGraphicsContext currentContext] : [NSGraphicsContext graphicsContextWithWindow:fl_window];
if (!nsgc) { // this occurs on 10.14 when through_Fl_X_flush==0
[[fl_window contentView] lockFocus];
nsgc = [NSGraphicsContext currentContext];
}
gc = (CGContextRef)[nsgc graphicsPort];
Fl_Graphics_Driver::default_driver().gc(gc);
CGContextSaveGState(gc); // native context