Add member variable Window Fl_Wayland_Image_Surface_Driver::pre_window.

This commit is contained in:
ManoloFLTK 2022-03-16 08:00:45 +01:00
parent 576fbcde53
commit 6235abf79d
2 changed files with 4 additions and 0 deletions

View File

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

View File

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