From 8f142b938ae5bbbb5a7677f1a7e71ee6308a7589 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Tue, 3 Mar 2020 19:03:29 +0100 Subject: [PATCH] Fix for STR#3534 to draw correctly Fl_Tiled_Image's on non-display surfaces. --- src/Fl_Window.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Fl_Window.cxx b/src/Fl_Window.cxx index 0b4961062..fb77cf01d 100644 --- a/src/Fl_Window.cxx +++ b/src/Fl_Window.cxx @@ -482,6 +482,9 @@ void Fl_Window::flush() void Fl_Window::draw() { + Fl_Window *save_current = current_; + bool to_display = Fl_Display_Device::display_device()->is_current(); + if (!to_display) current_ = this; // so drawing of background Fl_Tiled_Image is correct pWindowDriver->draw_begin(); // The following is similar to Fl_Group::draw(), but ... @@ -510,6 +513,7 @@ void Fl_Window::draw() draw_children(); pWindowDriver->draw_end(); + if (!to_display) current_ = save_current; # if defined(FLTK_USE_CAIRO) Fl::cairo_make_current(this); // checkout if an update is necessary # endif