From 13e05f4204cc636e40fd2591898c482aa0085226 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 7 Sep 2022 14:40:16 +0200 Subject: Improve support of child windows that may leak outside their parent window. 1) add Wayland code that prevent subwindows from leaking outside their parent. This does not cover GL subwindows. 2) add macOS code that prevent GL subwindows from leaking outside their parent. This fixes issue #494 for the macOS platform. N.B.: Wayland GL subwindows are not prevented from leaking because no solution that would not require any change in client applications was found. Code that would cover Wayland GL subwindows but would require client applications to always use the FL_ALPHA flag is included in this commit in commented out form. --- src/Fl_Gl_Window_Driver.H | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Fl_Gl_Window_Driver.H') diff --git a/src/Fl_Gl_Window_Driver.H b/src/Fl_Gl_Window_Driver.H index e123c177a..8f3f6cf29 100644 --- a/src/Fl_Gl_Window_Driver.H +++ b/src/Fl_Gl_Window_Driver.H @@ -101,6 +101,9 @@ public: virtual Fl_Font_Descriptor** fontnum_to_fontdescriptor(int fnum); virtual Fl_RGB_Image* capture_gl_rectangle(int x, int y, int w, int h); static inline Fl_Gl_Window_Driver* driver(const Fl_Gl_Window *win) {return win->pGlWindowDriver;} + // true means the platform uses glScissor() to make sure GL subwindows + // don't leak outside their parent window + virtual bool need_scissor() { return false; } }; #endif /* Fl_Gl_Window_Driver_H */ -- cgit v1.2.3