diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-08-21 12:01:01 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-08-21 12:01:51 +0200 |
| commit | 33eb87940dcc672ac50a3c1a26b437e7f1320112 (patch) | |
| tree | 41b5bb34424657f9670f812abe8c8e446fddb3ff /src/Fl_Screen_Driver.cxx | |
| parent | 5255640e7a09f4310946bdd36a3db33c69f5b356 (diff) | |
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).
Diffstat (limited to 'src/Fl_Screen_Driver.cxx')
| -rw-r--r-- | src/Fl_Screen_Driver.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
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; |
