From 94fffb701ce88adf7398fb37a007a04c08f1ca6f Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Thu, 6 Jun 2019 18:28:49 +0200 Subject: Add one argument to Fl_Screen_Driver::read_win_rectangle() The new argument gives the window to be captured, or NULL to indicate capture from the current offscreen. Calling this function becomes easier because less dependent on global variables. --- src/Fl_Screen_Driver.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Fl_Screen_Driver.cxx') diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx index 4f4bbff7f..93d0a23ea 100644 --- a/src/Fl_Screen_Driver.cxx +++ b/src/Fl_Screen_Driver.cxx @@ -196,8 +196,7 @@ Fl_RGB_Image *Fl_Screen_Driver::traverse_to_gl_subwindows(Fl_Group *g, int x, in full_img = plugin->rectangle_capture(g, x, y, w, h); } else if ( g->as_window() ) { - if (Fl_Window::current() != g) g->as_window()->make_current(); - full_img = Fl::screen_driver()->read_win_rectangle(x, y, w, h); + full_img = Fl::screen_driver()->read_win_rectangle(x, y, w, h, g->as_window()); } if (!full_img) return NULL; float full_img_scale = (full_img && w > 0 ? float(full_img->data_w())/w : 1); -- cgit v1.2.3