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
This commit is contained in:
Manolo Gouy 2018-10-05 10:47:16 +00:00
parent a84dec9510
commit 506b60a3f9
1 changed files with 3 additions and 1 deletions

View File

@ -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 ) {