diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-02-07 18:27:24 +0200 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-02-07 18:29:48 +0200 |
commit | d87459dd8310b5e29ad00ab03fb2913b795ba3f7 (patch) | |
tree | 4e81c705e067658f92515f1b9b7dddee77855f4b | |
parent | 662d408f06bf3f4087cf0f5ff2a472523f250235 (diff) | |
download | metacity-d87459dd8310b5e29ad00ab03fb2913b795ba3f7.tar.gz |
libmetacity: make sure invisible area is large enough
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | libmetacity/meta-frame-layout.h | 4 | ||||
-rw-r--r-- | libmetacity/meta-theme-gtk.c | 36 |
3 files changed, 37 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 73cca30c..806f2ac3 100644 --- a/configure.ac +++ b/configure.ac @@ -69,7 +69,7 @@ dnl Check for required packages dnl ************************************************************************** GLIB_REQUIRED_VERSION=2.44.0 -GTK_REQUIRED_VERSION=3.19.7 +GTK_REQUIRED_VERSION=3.19.8 PKG_CHECK_MODULES([LIBMETACITY], [ glib-2.0 >= $GLIB_REQUIRED_VERSION diff --git a/libmetacity/meta-frame-layout.h b/libmetacity/meta-frame-layout.h index 23b97912..edcf270a 100644 --- a/libmetacity/meta-frame-layout.h +++ b/libmetacity/meta-frame-layout.h @@ -56,6 +56,10 @@ struct _MetaFrameLayout struct { /** Border/padding of the entire frame */ GtkBorder frame_border; + + /** Shadow border used in invisible resize area */ + GtkBorder shadow_border; + /** Border/padding of the titlebar region */ GtkBorder titlebar_border; /** Border/padding of titlebar buttons */ diff --git a/libmetacity/meta-theme-gtk.c b/libmetacity/meta-theme-gtk.c index 1bf12217..24c46a88 100644 --- a/libmetacity/meta-theme-gtk.c +++ b/libmetacity/meta-theme-gtk.c @@ -18,6 +18,7 @@ #include "config.h" #include <gtk/gtk.h> +#include <stdlib.h> #include <string.h> #include "meta-frame-style.h" @@ -193,6 +194,20 @@ scale_border (GtkBorder *border, } static void +get_shadow_extents (GtkStyleContext *style, + GtkBorder *border) +{ + GdkRectangle clip; + + gtk_render_background_get_clip (style, 0, 0, 0, 0, &clip); + + border->left = abs (clip.x); + border->top = abs (clip.y); + border->right = clip.width - border->left; + border->bottom = clip.height - border->bottom; +} + +static void frame_layout_sync_with_style (MetaFrameLayout *layout, MetaStyleInfo *style_info, gboolean composited, @@ -213,6 +228,7 @@ frame_layout_sync_with_style (MetaFrameLayout *layout, { /* With compositing manager: margin is resize area */ get_margin (style, &layout->invisible_resize_border); + get_shadow_extents (style, &layout->gtk.shadow_border); } else { @@ -222,6 +238,11 @@ frame_layout_sync_with_style (MetaFrameLayout *layout, layout->invisible_resize_border.left = 0; layout->invisible_resize_border.right = 0; + layout->gtk.shadow_border.top = 0; + layout->gtk.shadow_border.bottom = 0; + layout->gtk.shadow_border.left = 0; + layout->gtk.shadow_border.right = 0; + /* Without compositing manager: margin is part of border */ get_margin (style, &border); @@ -339,18 +360,25 @@ meta_theme_gtk_get_frame_borders (MetaThemeImpl *impl, borders->visible.right = layout->gtk.frame_border.right; borders->visible.bottom = layout->gtk.frame_border.bottom; + borders->invisible = layout->gtk.shadow_border; + if (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE) { - borders->invisible.left = layout->invisible_resize_border.left; - borders->invisible.right = layout->invisible_resize_border.right; + borders->invisible.left = MAX (borders->invisible.left, + layout->invisible_resize_border.left); + + borders->invisible.right = MAX (borders->invisible.right, + layout->invisible_resize_border.right); } if (flags & META_FRAME_ALLOWS_VERTICAL_RESIZE) { - borders->invisible.bottom = layout->invisible_resize_border.bottom; + borders->invisible.bottom = MAX (borders->invisible.bottom, + layout->invisible_resize_border.bottom); if (type != META_FRAME_TYPE_ATTACHED) - borders->invisible.top = layout->invisible_resize_border.top; + borders->invisible.top = MAX (borders->invisible.top, + layout->invisible_resize_border.top); } borders->total.left = borders->invisible.left + borders->visible.left; |