From 6235abf79da7c3737980c699c14242cb59840042 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 16 Mar 2022 08:00:45 +0100 Subject: [PATCH] Add member variable Window Fl_Wayland_Image_Surface_Driver::pre_window. --- src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.H | 2 ++ src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.cxx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.H b/src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.H index cb80d355a..66ad51d78 100644 --- a/src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.H +++ b/src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.H @@ -21,10 +21,12 @@ class Fl_Wayland_Image_Surface_Driver : public Fl_Image_Surface_Driver { virtual void end_current(); + Window pre_window; public: Fl_Wayland_Image_Surface_Driver(int w, int h, int high_res, Fl_Offscreen off); ~Fl_Wayland_Image_Surface_Driver(); void set_current(); + void end_current(); void translate(int x, int y); void untranslate(); Fl_RGB_Image *image(); diff --git a/src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.cxx index 5c18d3774..3e25b7873 100644 --- a/src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.cxx @@ -56,12 +56,14 @@ Fl_Wayland_Image_Surface_Driver::~Fl_Wayland_Image_Surface_Driver() { void Fl_Wayland_Image_Surface_Driver::set_current() { Fl_Surface_Device::set_current(); ((Fl_Wayland_Graphics_Driver*)fl_graphics_driver)->activate(offscreen, driver()->scale()); + pre_window = fl_window; fl_window = NULL; } void Fl_Wayland_Image_Surface_Driver::end_current() { cairo_surface_t *surf = cairo_get_target(offscreen->cairo_); cairo_surface_flush(surf); + fl_window = pre_window; } void Fl_Wayland_Image_Surface_Driver::translate(int x, int y) {