diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-04-11 19:02:44 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-04-11 19:02:44 +0200 |
| commit | d36e1a79c312f0a1da8223cb5adb9c4b3b9c7cd6 (patch) | |
| tree | df01116c9983c1692e3fc74a6831d32554d6798e /src/Fl_Screen_Driver.cxx | |
| parent | 3fa2b736984a21cba25d9615c802cfa45afb511c (diff) | |
Add check against hidden window.
Diffstat (limited to 'src/Fl_Screen_Driver.cxx')
| -rw-r--r-- | src/Fl_Screen_Driver.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx index c42cefe1c..4f4bbff7f 100644 --- a/src/Fl_Screen_Driver.cxx +++ b/src/Fl_Screen_Driver.cxx @@ -184,7 +184,8 @@ Image depths can differ between "to" and "from". will be partially overwritten with the new capture Return value: - An Fl_RGB_Image*, the depth of which is platform-dependent, containing the captured pixels. + An Fl_RGB_Image*, the depth of which is platform-dependent, containing the captured pixels, + or NULL if capture failed. */ 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) @@ -198,6 +199,7 @@ Fl_RGB_Image *Fl_Screen_Driver::traverse_to_gl_subwindows(Fl_Group *g, int x, in if (Fl_Window::current() != g) g->as_window()->make_current(); full_img = Fl::screen_driver()->read_win_rectangle(x, y, w, h); } + if (!full_img) return NULL; float full_img_scale = (full_img && w > 0 ? float(full_img->data_w())/w : 1); int n = g->children(); for (int i = 0; i < n; i++) { |
