From 3261bbdce6cc0fa494c257849cb69c640f1aeade Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Tue, 9 Sep 2025 10:34:49 -0400 Subject: theme: Include shadow and resize borders Extend MetaFrameBorders to include shadow and resize borders to calculate invisible border size. Also added border caching to prevent recalculating borders on every frame operation. This is a backport of the following commits from Metacity: - https://gitlab.gnome.org/GNOME/metacity/-/commit/21e664af - https://gitlab.gnome.org/GNOME/metacity/-/commit/3c6e269b - https://gitlab.gnome.org/GNOME/metacity/-/commit/700e87ea --- src/include/common.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/include/common.h') diff --git a/src/include/common.h b/src/include/common.h index 031274f6..a0dfb69c 100644 --- a/src/include/common.h +++ b/src/include/common.h @@ -310,15 +310,11 @@ struct _MetaButtonLayout typedef struct _MetaFrameBorders MetaFrameBorders; struct _MetaFrameBorders { - /* The frame border is made up of two pieces - an inner visible portion - * and an outer portion that is invisible but responds to events. - */ - GtkBorder visible; - GtkBorder invisible; - - /* For convenience, we have a "total" border which is equal to the sum - * of the two borders above. */ - GtkBorder total; + GtkBorder visible; /* Visible window frame decoration */ + GtkBorder shadow; /* Extra size needed for shadow */ + GtkBorder resize; /* Extra size used for resize cursor area */ + GtkBorder invisible; /* Max of shadow and resize borders */ + GtkBorder total; /* Sum of visible and invisible borders */ }; /* sets all dimensions to zero */ -- cgit v1.2.1