diff options
author | Victor Kareh <[email protected]> | 2019-05-21 13:15:48 -0400 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-06-16 18:12:44 +0200 |
commit | 860f7a6dbc81272c561a1b8d045e5ff61ea0e66a (patch) | |
tree | b81ee0c5ff3402451009294690e204d0d242e794 /src/ui/preview-widget.c | |
parent | cfd49bdf68ef48fcd53a084c74626372fc169688 (diff) | |
download | marco-860f7a6dbc81272c561a1b8d045e5ff61ea0e66a.tar.bz2 marco-860f7a6dbc81272c561a1b8d045e5ff61ea0e66a.tar.xz |
MetaFrameBorders: Add meta_frame_borders_clear
Just a quick little commit to help clean things up for when we add invisible
borders. Additionally, do a little housekeeping in preview-widget as well.
https://bugzilla.gnome.org/show_bug.cgi?id=644930
NOTE: Patch copied from metacity and adapted for marco.
upstream commit:
https://gitlab.gnome.org/GNOME/metacity/commit/7d519b3f
Diffstat (limited to 'src/ui/preview-widget.c')
-rw-r--r-- | src/ui/preview-widget.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/ui/preview-widget.c b/src/ui/preview-widget.c index 1db34950..e5573c6e 100644 --- a/src/ui/preview-widget.c +++ b/src/ui/preview-widget.c @@ -98,10 +98,7 @@ meta_preview_init (MetaPreview *preview) META_FRAME_ALLOWS_SHADE | META_FRAME_ALLOWS_MOVE; - preview->borders.visible.left = -1; - preview->borders.visible.right = -1; - preview->borders.visible.top = -1; - preview->borders.visible.bottom = -1; + preview->borders_cached = FALSE; } GtkWidget* @@ -172,23 +169,17 @@ ensure_info (MetaPreview *preview) pango_font_description_free (font_desc); } - if (preview->borders.visible.top < 0) + if (!preview->borders_cached) { if (preview->theme) - { meta_theme_get_frame_borders (preview->theme, preview->type, preview->text_height, preview->flags, &preview->borders); - } else - { - preview->borders.visible.top = 0; - preview->borders.visible.bottom = 0; - preview->borders.visible.left = 0; - preview->borders.visible.right = 0; - } + meta_frame_borders_clear (&preview->borders); + preview->borders_cached = TRUE; } } @@ -364,10 +355,7 @@ clear_cache (MetaPreview *preview) preview->layout = NULL; } - preview->borders.visible.left = -1; - preview->borders.visible.right = -1; - preview->borders.visible.top = -1; - preview->borders.visible.bottom = -1; + preview->borders_cached = FALSE; } void |