summaryrefslogtreecommitdiff
path: root/libmetacity/meta-draw-op.c
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2016-03-24 17:09:39 +0200
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2016-03-24 17:09:39 +0200
commitdc463c912456416e1a5a6c1f7b213921b99f9522 (patch)
treee6d721b5437f8ca39e9bb9dabe97c4bd8b1e6ee6 /libmetacity/meta-draw-op.c
parent57c3fb46993a730f01ba8619832dde119f53c863 (diff)
downloadmetacity-wip/window-scaling-factor.tar.gz
libmetacity: correcty center titlewip/window-scaling-factor
Diffstat (limited to 'libmetacity/meta-draw-op.c')
-rw-r--r--libmetacity/meta-draw-op.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/libmetacity/meta-draw-op.c b/libmetacity/meta-draw-op.c
index 23c3c9de..03bd3057 100644
--- a/libmetacity/meta-draw-op.c
+++ b/libmetacity/meta-draw-op.c
@@ -22,6 +22,7 @@
#include <math.h>
#include "meta-draw-op-private.h"
+#include "meta-theme-impl-private.h"
#define GDK_COLOR_RGBA(color) \
((guint32) (0xff | \
@@ -58,18 +59,22 @@ fill_env (MetaPositionExprEnv *env,
const MetaDrawInfo *info,
GdkRectangle logical_region)
{
+ int scale;
+
+ scale = get_window_scaling_factor ();
+
/* FIXME this stuff could be raised into draw_op_list_draw() probably
*/
env->rect = logical_region;
env->object_width = -1;
env->object_height = -1;
- 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->left_width = info->borders.visible.left / scale;
+ env->right_width = info->borders.visible.right / scale;
+ env->top_height = info->borders.visible.top / scale;
+ env->bottom_height = info->borders.visible.bottom / scale;
+ env->frame_x_center = info->width / scale / 2 - logical_region.x;
+ env->frame_y_center = info->height / scale / 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;