Use the new Fl_Surface_Device::is_current() virtual function

This commit is contained in:
ManoloFLTK
2019-04-10 13:53:13 +02:00
parent 4f0a16697e
commit d5943f85b9
@@ -62,7 +62,7 @@ Fl_Xlib_Copy_Surface_Driver::Fl_Xlib_Copy_Surface_Driver(int w, int h) : Fl_Copy
Fl_Xlib_Copy_Surface_Driver::~Fl_Xlib_Copy_Surface_Driver() {
driver()->pop_clip();
bool need_push = (Fl_Surface_Device::surface() != this);
bool need_push = !is_current();
if (need_push) Fl_Surface_Device::push_current(this);
Fl_RGB_Image *rgb = Fl::screen_driver()->read_win_rectangle(0, 0, width, height);
if (need_push) Fl_Surface_Device::pop_current();