summaryrefslogtreecommitdiff
path: root/src/drivers/Wayland/Fl_Wayland_Window_Driver.H
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-09-07 14:40:16 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-09-07 14:40:16 +0200
commit13e05f4204cc636e40fd2591898c482aa0085226 (patch)
tree25acdfdf8d5ea774869e577ee94a7e94d8b3e34c /src/drivers/Wayland/Fl_Wayland_Window_Driver.H
parentdeeb977c2e99cbd2f6ccfb781c34c7d60de8ebce (diff)
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.
Diffstat (limited to 'src/drivers/Wayland/Fl_Wayland_Window_Driver.H')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Window_Driver.H5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.H b/src/drivers/Wayland/Fl_Wayland_Window_Driver.H
index 5bd73ab04..c8b959d17 100644
--- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.H
+++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.H
@@ -41,6 +41,7 @@
*/
typedef struct _cairo_pattern cairo_pattern_t;
+typedef struct _cairo_rectangle_int cairo_rectangle_int_t;
class Fl_Wayland_Plugin;
@@ -56,6 +57,7 @@ private:
Fl_Image* shape_; ///< shape image
cairo_pattern_t *mask_pattern_;
} *shape_data_;
+ cairo_rectangle_int_t *subRect_; // makes sure subwindow remains inside its parent window
static bool in_flush; // useful for progressive window drawing
static Fl_Wayland_Plugin *gl_plugin();
struct wl_cursor *cursor_;
@@ -78,6 +80,9 @@ public:
void shape_bitmap_(Fl_Image* b);
void shape_alpha_(Fl_Image* img, int offset);
void update_scale();
+ cairo_rectangle_int_t *subRect() { return subRect_; } // getter
+ void subRect(cairo_rectangle_int_t *r); // setter
+ void checkSubwindowFrame();
enum kind {DECORATED, SUBWINDOW, POPUP, UNFRAMED};
struct xdg_toplevel *xdg_toplevel();
Fl_Wayland_Window_Driver(Fl_Window*);