From 33eb87940dcc672ac50a3c1a26b437e7f1320112 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 21 Aug 2019 12:01:01 +0200 Subject: Fix a case when fl_read_window() did not capture subwindows correctly. The case was under macOS with a non-GL parent window mapped to a retina display containing a GL subwindow and if the app did not call Fl::use_high_res_GL(1). --- src/Fl_Screen_Driver.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Fl_Screen_Driver.cxx') diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx index cc54d53cb..c18cd40d3 100644 --- a/src/Fl_Screen_Driver.cxx +++ b/src/Fl_Screen_Driver.cxx @@ -190,17 +190,18 @@ Image depths can differ between "to" and "from". Fl_RGB_Image *Fl_Screen_Driver::traverse_to_gl_subwindows(Fl_Group *g, int x, int y, int w, int h, Fl_RGB_Image *full_img) { + bool captured_subwin = false; if ( g->as_gl_window() ) { Fl_Device_Plugin *plugin = Fl_Device_Plugin::opengl_plugin(); if (!plugin) return full_img; full_img = plugin->rectangle_capture(g, x, y, w, h); } else if ( g->as_window() ) { - full_img = Fl::screen_driver()->read_win_rectangle(x, y, w, h, g->as_window()); + full_img = Fl::screen_driver()->read_win_rectangle(x, y, w, h, g->as_window(), true, &captured_subwin); } if (!full_img) return NULL; float full_img_scale = (full_img && w > 0 ? float(full_img->data_w())/w : 1); - int n = g->children(); + int n = (captured_subwin ? 0 : g->children()); for (int i = 0; i < n; i++) { Fl_Widget *c = g->child(i); if ( !c->visible() || !c->as_group()) continue; -- cgit v1.2.3