From c66b32666e48996b97e691ed002f86b6ff18dec5 Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Fri, 12 Apr 2019 07:58:30 -0400 Subject: Replace public MetaFrameGeometry with MetaFrameBorders There were actually *two* MetaFrameGeometry structs: one in theme-private.h, one in frame.h. The latter public struct was populated by a mix of (void*) casting and int pointers, usually pulling directly from the data in the private struct. Remove the public struct, replace it with MetaFrameBorders and scrap all the pointer hacks to populate it, instead relying on both structs being used in common code. This commit should be relatively straightforward, and it should not do any tricky logic at all, just a sophisticated find and replace. https://bugzilla.gnome.org/show_bug.cgi?id=644930 upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/72224a165 NOTE: Patch copied from metacity and adapted for marco. --- src/include/common.h | 12 +++++++++++- src/include/ui.h | 18 +++++++----------- 2 files changed, 18 insertions(+), 12 deletions(-) (limited to 'src/include') diff --git a/src/include/common.h b/src/include/common.h index 9468d1dd..c49ad5de 100644 --- a/src/include/common.h +++ b/src/include/common.h @@ -25,9 +25,10 @@ #ifndef META_COMMON_H #define META_COMMON_H -/* Don't include GTK or core headers here */ +/* Don't include core headers here */ #include #include +#include typedef struct _MetaResizePopup MetaResizePopup; @@ -300,6 +301,15 @@ struct _MetaButtonLayout gboolean right_buttons_has_spacer[MAX_BUTTONS_PER_CORNER]; }; +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; +}; + /* should investigate changing these to whatever most apps use */ #define META_DEFAULT_ICON_SIZE 48 #define META_MIN_ICON_SIZE 6 diff --git a/src/include/ui.h b/src/include/ui.h index ba9b1696..bbfaf287 100644 --- a/src/include/ui.h +++ b/src/include/ui.h @@ -62,17 +62,13 @@ MetaUI* meta_ui_new (Display *xdisplay, Screen *screen); void meta_ui_free (MetaUI *ui); -void meta_ui_theme_get_frame_borders (MetaUI *ui, - MetaFrameType type, - MetaFrameFlags flags, - int *top_height, - int *bottom_height, - int *left_width, - int *right_width); -void meta_ui_get_frame_geometry (MetaUI *ui, - Window frame_xwindow, - int *top_height, int *bottom_height, - int *left_width, int *right_width); +void meta_ui_theme_get_frame_borders (MetaUI *ui, + MetaFrameType type, + MetaFrameFlags flags, + MetaFrameBorders *borders); +void meta_ui_get_frame_borders (MetaUI *ui, + Window frame_xwindow, + MetaFrameBorders *borders); Window meta_ui_create_frame_window (MetaUI *ui, Display *xdisplay, Visual *xvisual, -- cgit v1.2.1