summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2025-09-09 10:34:49 -0400
committerVictor Kareh <[email protected]>2026-01-21 16:37:58 -0500
commitab345b7ebe6fc0be1458f2dbbe4b75fcf97392bd (patch)
tree132c7e1e63d1ef57843fb1545b875966e37e1ed6 /src/include
parent85ac676d17b2f5cf14b4f54199c5166154f9867a (diff)
downloadmarco-ab345b7ebe6fc0be1458f2dbbe4b75fcf97392bd.tar.bz2
marco-ab345b7ebe6fc0be1458f2dbbe4b75fcf97392bd.tar.xz
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
Diffstat (limited to 'src/include')
-rw-r--r--src/include/common.h14
-rw-r--r--src/include/frame.h1
2 files changed, 6 insertions, 9 deletions
diff --git a/src/include/common.h b/src/include/common.h
index 9febd63c..a12cded4 100644
--- a/src/include/common.h
+++ b/src/include/common.h
@@ -304,15 +304,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 */
diff --git a/src/include/frame.h b/src/include/frame.h
index 97314d4b..2deba88b 100644
--- a/src/include/frame.h
+++ b/src/include/frame.h
@@ -30,5 +30,6 @@
Window meta_frame_get_xwindow (MetaFrame *frame);
void meta_frame_calc_borders (MetaFrame *frame,
MetaFrameBorders *borders);
+void meta_frame_clear_cached_borders (MetaFrame *frame);
#endif