[metacity] theme: don't use MetaFrameGeometry in MetaDrawInfo
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] theme: don't use MetaFrameGeometry in MetaDrawInfo
- Date: Fri, 29 Jan 2016 00:11:17 +0000 (UTC)
commit 50bb3d8ef169ab1ba39af4f1a007144132fb569c
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Fri Jan 29 01:25:57 2016 +0200
theme: don't use MetaFrameGeometry in MetaDrawInfo
src/ui/theme-private.h | 5 ++++-
src/ui/theme.c | 30 +++++++++++-------------------
2 files changed, 15 insertions(+), 20 deletions(-)
---
diff --git a/src/ui/theme-private.h b/src/ui/theme-private.h
index ebfc6e8..8521f4a 100644
--- a/src/ui/theme-private.h
+++ b/src/ui/theme-private.h
@@ -277,7 +277,10 @@ struct _MetaDrawInfo
PangoLayout *title_layout;
int title_layout_width;
int title_layout_height;
- const MetaFrameGeometry *fgeom;
+
+ MetaFrameBorders borders;
+ gint width;
+ gint height;
};
/**
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 10598cf..bc2fc58 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -1772,24 +1772,13 @@ fill_env (MetaPositionExprEnv *env,
env->rect = logical_region;
env->object_width = -1;
env->object_height = -1;
- if (info->fgeom)
- {
- env->left_width = info->fgeom->borders.visible.left;
- env->right_width = info->fgeom->borders.visible.right;
- env->top_height = info->fgeom->borders.visible.top;
- env->bottom_height = info->fgeom->borders.visible.bottom;
- env->frame_x_center = info->fgeom->width / 2 - logical_region.x;
- env->frame_y_center = info->fgeom->height / 2 - logical_region.y;
- }
- else
- {
- env->left_width = 0;
- env->right_width = 0;
- env->top_height = 0;
- env->bottom_height = 0;
- env->frame_x_center = 0;
- env->frame_y_center = 0;
- }
+
+ env->left_width = info->borders.visible.left;
+ env->right_width = info->borders.visible.right;
+ env->top_height = info->borders.visible.top;
+ env->bottom_height = info->borders.visible.bottom;
+ env->frame_x_center = info->width / 2 - logical_region.x;
+ env->frame_y_center = info->height / 2 - logical_region.y;
env->mini_icon_width = info->mini_icon ? gdk_pixbuf_get_width (info->mini_icon) : 0;
env->mini_icon_height = info->mini_icon ? gdk_pixbuf_get_height (info->mini_icon) : 0;
@@ -2946,7 +2935,10 @@ meta_frame_style_draw_with_style (MetaFrameStyle *style,
draw_info.title_layout = title_layout;
draw_info.title_layout_width = title_layout ? extents.width : 0;
draw_info.title_layout_height = title_layout ? extents.height : 0;
- draw_info.fgeom = fgeom;
+
+ draw_info.borders = fgeom->borders;
+ draw_info.width = fgeom->width;
+ draw_info.height = fgeom->height;
/* The enum is in the order the pieces should be rendered. */
i = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]