diff options
| author | Manolo Gouy <Manolo> | 2018-09-27 05:42:57 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2018-09-27 05:42:57 +0000 |
| commit | f76d2a2bf8c35c0c313f05bbd6deda49dd344efc (patch) | |
| tree | 48a8ccd36ddd9c833217bfb061c40099d0ee7e8c /src | |
| parent | 673d95b99cfb1f740691c098d7912b19d868ed96 (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 835e278c9..fb8414de1 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -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 |
