summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-04-11 19:02:44 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-04-11 19:02:44 +0200
commitd36e1a79c312f0a1da8223cb5adb9c4b3b9c7cd6 (patch)
treedf01116c9983c1692e3fc74a6831d32554d6798e /src
parent3fa2b736984a21cba25d9615c802cfa45afb511c (diff)
Add check against hidden window.
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Screen_Driver.cxx4
-rw-r--r--src/Fl_Widget_Surface.cxx1
2 files changed, 4 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++) {
diff --git a/src/Fl_Widget_Surface.cxx b/src/Fl_Widget_Surface.cxx
index 79e4fb33e..90c6820ab 100644
--- a/src/Fl_Widget_Surface.cxx
+++ b/src/Fl_Widget_Surface.cxx
@@ -153,6 +153,7 @@ void Fl_Widget_Surface::origin(int x, int y) {
*/
void Fl_Widget_Surface::print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x, int delta_y)
{
+ if (!win->shown()) return;
bool need_push = !Fl_Display_Device::display_device()->is_current();
if (need_push) Fl_Surface_Device::push_current(Fl_Display_Device::display_device());
Fl_Window *save_front = Fl::first_window();