From b9d13506d486ddd21c3e019baa8236d0a4438b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= Date: Sat, 4 Apr 2015 20:08:05 +0300 Subject: theme: read margin from gtk+ theme And use it as invisible area for resizing if compositing manager is running otherwise use as extra size for visible border. --- src/ui/theme.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/ui/theme.c b/src/ui/theme.c index 1bbb9932..fc16f9fa 100644 --- a/src/ui/theme.c +++ b/src/ui/theme.c @@ -624,6 +624,17 @@ strip_button (MetaButtonSpace *func_rects[MAX_BUTTONS_PER_CORNER], return FALSE; /* did not strip anything */ } +static void +get_margin (GtkStyleContext *style, + GtkBorder *border) +{ + GtkStateFlags state; + + state = gtk_style_context_get_state (style); + + gtk_style_context_get_margin (style, state, border); +} + static void get_padding_and_border (GtkStyleContext *style, GtkBorder *border) @@ -678,6 +689,17 @@ meta_frame_layout_sync_with_style (MetaFrameLayout *layout, layout->right_width = border.right; layout->bottom_height = border.bottom; + if (compositing_manager) + get_margin (style, &layout->invisible_border); + else + { + get_margin (style, &border); + + layout->left_width += border.left; + layout->right_width += border.right; + layout->bottom_height += border.bottom; + } + if (layout->hide_buttons) layout->icon_size = 0; -- cgit v1.2.1