[metacity] libmetacity: add scale to MetaDrawInfo
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] libmetacity: add scale to MetaDrawInfo
- Date: Mon, 28 Nov 2016 15:05:10 +0000 (UTC)
commit c54fa264dbbf4cf4df45e049778a95bc609f49b8
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Nov 28 17:00:08 2016 +0200
libmetacity: add scale to MetaDrawInfo
libmetacity/meta-draw-op-private.h | 14 ++++++++------
libmetacity/meta-draw-op.c | 3 +--
libmetacity/meta-theme-metacity.c | 2 ++
3 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/libmetacity/meta-draw-op-private.h b/libmetacity/meta-draw-op-private.h
index 138ecec..5ddb81b 100644
--- a/libmetacity/meta-draw-op-private.h
+++ b/libmetacity/meta-draw-op-private.h
@@ -77,16 +77,18 @@ typedef enum
struct _MetaDrawInfo
{
+ gint scale;
+
GdkPixbuf *mini_icon;
GdkPixbuf *icon;
PangoLayout *title_layout;
- int title_layout_width;
- int title_layout_height;
+ gint title_layout_width;
+ gint title_layout_height;
- gint left_width;
- gint right_width;
- gint top_height;
- gint bottom_height;
+ gint left_width;
+ gint right_width;
+ gint top_height;
+ gint bottom_height;
gdouble width;
gdouble height;
diff --git a/libmetacity/meta-draw-op.c b/libmetacity/meta-draw-op.c
index edbab26..e2d59ec 100644
--- a/libmetacity/meta-draw-op.c
+++ b/libmetacity/meta-draw-op.c
@@ -22,7 +22,6 @@
#include <math.h>
#include "meta-draw-op-private.h"
-#include "meta-theme-impl-private.h"
#define GDK_COLOR_RGB(color) \
((guint32) (((int)((color).red * 255) << 16) | \
@@ -558,7 +557,7 @@ draw_op_draw_with_env (const MetaDrawOp *op,
gdouble rx, ry, rwidth, rheight;
cairo_surface_t *surface;
- scale = get_window_scaling_factor ();
+ scale = info->scale;
cairo_scale (cr, 1.0 / scale, 1.0 / scale);
if (op->data.image.pixbuf)
diff --git a/libmetacity/meta-theme-metacity.c b/libmetacity/meta-theme-metacity.c
index d39a2dd..702d092 100644
--- a/libmetacity/meta-theme-metacity.c
+++ b/libmetacity/meta-theme-metacity.c
@@ -5358,6 +5358,8 @@ meta_theme_metacity_draw_frame (MetaThemeImpl *impl,
pango_layout_get_pixel_extents (title_layout,
NULL, &extents);
+ draw_info.scale = scale;
+
draw_info.mini_icon = mini_icon;
draw_info.icon = icon;
draw_info.title_layout = title_layout;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]