Add check against hidden window.

This commit is contained in:
ManoloFLTK 2019-04-11 19:02:44 +02:00
parent 3fa2b73698
commit d36e1a79c3
2 changed files with 4 additions and 1 deletions

View File

@ -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++) {

View File

@ -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();