summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-01-16 15:16:36 -0500
committerMatthias Clasen <mclasen@redhat.com>2021-01-16 15:22:46 -0500
commitaefc630d29c4d9b57229bcffd7461bf02598ce20 (patch)
treefcd645707bd2308713e3a5db6f2bc010bde388b3
parent691b6b88ead6abfe8d675e42bc24c07a7df9a579 (diff)
downloadgtk+-aefc630d29c4d9b57229bcffd7461bf02598ce20.tar.gz
surface: Add a scale-factor property
This will allow us to notify when the scale changes.
-rw-r--r--gdk/gdksurface.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 35c47a3476..ec48ad3543 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -92,6 +92,7 @@ enum {
PROP_MAPPED,
PROP_WIDTH,
PROP_HEIGHT,
+ PROP_SCALE_FACTOR,
LAST_PROP
};
@@ -551,6 +552,13 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
0, G_MAXINT, 0,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+ properties[PROP_SCALE_FACTOR] =
+ g_param_spec_int ("scale-factor",
+ P_("Scale factor"),
+ P_("Scale factor"),
+ 1, G_MAXINT, 1,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
g_object_class_install_properties (object_class, LAST_PROP, properties);
/**
@@ -782,6 +790,10 @@ gdk_surface_get_property (GObject *object,
g_value_set_int (value, surface->height);
break;
+ case PROP_SCALE_FACTOR:
+ g_value_set_int (value, gdk_surface_get_scale_factor (surface));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;