From 24fa104b61e881fa53632372f8309d0bdcb4f5f6 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 22 Apr 2019 01:14:28 +0000 Subject: [PATCH] surface: Add a frame-clock property Now that GdkSurface has properties, it makes sense to turn the frame clock into one too. This will make it easier to reshuffle some of the surface constructors later. --- gdk/gdksurface.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c index 552d5e8bae..589a17dfa7 100644 --- a/gdk/gdksurface.c +++ b/gdk/gdksurface.c @@ -107,6 +107,7 @@ enum { PROP_0, PROP_CURSOR, PROP_DISPLAY, + PROP_FRAME_CLOCK, PROP_STATE, PROP_MAPPED, LAST_PROP @@ -268,6 +269,13 @@ gdk_surface_class_init (GdkSurfaceClass *klass) GDK_TYPE_DISPLAY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); + properties[PROP_FRAME_CLOCK] = + g_param_spec_object ("frame-clock", + P_("Frame Clock"), + P_("Frame Clock"), + GDK_TYPE_FRAME_CLOCK, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); + properties[PROP_STATE] = g_param_spec_flags ("state", P_("State"), @@ -462,6 +470,10 @@ gdk_surface_set_property (GObject *object, g_assert (surface->display != NULL); break; + case PROP_FRAME_CLOCK: + gdk_surface_set_frame_clock (surface, GDK_FRAME_CLOCK (g_value_get_object (value))); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -486,6 +498,10 @@ gdk_surface_get_property (GObject *object, g_value_set_object (value, surface->display); break; + case PROP_FRAME_CLOCK: + g_value_set_object (value, surface->frame_clock); + break; + case PROP_STATE: g_value_set_flags (value, surface->state); break;