From 2aac32694c85ee077aff32adef8abc207703e9c0 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 12 Jan 2015 15:04:27 +0000 Subject: [PATCH] gdk: Implement get_scale_factor() Otherwise scaling will not work correctly. --- clutter/gdk/clutter-stage-gdk.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/clutter/gdk/clutter-stage-gdk.c b/clutter/gdk/clutter-stage-gdk.c index c0188e0c0..0ca8111bb 100644 --- a/clutter/gdk/clutter-stage-gdk.c +++ b/clutter/gdk/clutter-stage-gdk.c @@ -433,6 +433,17 @@ clutter_stage_gdk_can_clip_redraws (ClutterStageWindow *stage_window) return TRUE; } +static int +clutter_stage_gdk_get_scale_factor (ClutterStageWindow *stage_window) +{ + ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window); + + if (stage_gdk->window == NULL) + return 1; + + return gdk_window_get_scale_factor (stage_gdk->window); +} + static void clutter_stage_gdk_dispose (GObject *gobject) { @@ -489,6 +500,7 @@ clutter_stage_window_iface_init (ClutterStageWindowIface *iface) iface->realize = clutter_stage_gdk_realize; iface->unrealize = clutter_stage_gdk_unrealize; iface->can_clip_redraws = clutter_stage_gdk_can_clip_redraws; + iface->get_scale_factor = clutter_stage_gdk_get_scale_factor; } /**