From 506b60a3f9559eca23318ead9050ceda76891e87 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Fri, 5 Oct 2018 10:47:16 +0000 Subject: [PATCH] MacOS 10.14 Mojave: fix support of window capture - continued. Window capture by initWithFocusedViewRect: does not work if the app is linked against 10.14 SDK and run under 10.14. In that case, capture is performed instead by CGWindowListCreateImage(). Detection of whether the app was linked against 10.14 SDK is done by checking whether the FLView possesses a CALayer. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13062 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index ba0348015..64a662752 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -4091,8 +4091,10 @@ static NSBitmapImageRep* rect_to_NSBitmapImageRep(Fl_Window *win, int x, int y, float s = Fl_Graphics_Driver::default_driver().scale(); if (win->as_gl_window() && y >= 0) { bitmap = GL_rect_to_nsbitmap(win, x, y, w, h); - } else if (fl_mac_os_version >= 101400) { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 + } else if (fl_mac_os_version >= 101400 && [[fl_xid(win) contentView] layer /*10.5*/]) { bitmap = rect_to_NSBitmapImageRep_noredraw(win, x, y, w, h); +#endif } else { NSView *winview = nil; if ( through_Fl_X_flush && Fl_Window::current() == win ) {