From 86cb5f8a9802686be8966dc036098454412f74d3 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Thu, 5 Sep 2019 02:54:04 +0200 Subject: gs-grab-x11: avoid 'g_type_class_add_private' --- src/gs-grab-x11.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/gs-grab-x11.c b/src/gs-grab-x11.c index df95c5a..4330c76 100644 --- a/src/gs-grab-x11.c +++ b/src/gs-grab-x11.c @@ -37,10 +37,6 @@ static void gs_grab_class_init (GSGrabClass *klass); static void gs_grab_init (GSGrab *grab); static void gs_grab_finalize (GObject *object); -#define GS_GRAB_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GS_TYPE_GRAB, GSGrabPrivate)) - -G_DEFINE_TYPE (GSGrab, gs_grab, G_TYPE_OBJECT) - static gpointer grab_object = NULL; struct GSGrabPrivate @@ -53,6 +49,8 @@ struct GSGrabPrivate GtkWidget *invisible; }; +G_DEFINE_TYPE_WITH_PRIVATE (GSGrab, gs_grab, G_TYPE_OBJECT) + static const char * grab_string (int status) { @@ -406,14 +404,12 @@ gs_grab_class_init (GSGrabClass *klass) GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->finalize = gs_grab_finalize; - - g_type_class_add_private (klass, sizeof (GSGrabPrivate)); } static void gs_grab_init (GSGrab *grab) { - grab->priv = GS_GRAB_GET_PRIVATE (grab); + grab->priv = gs_grab_get_instance_private (grab); grab->priv->no_pointer_grab = FALSE; grab->priv->hide_cursor = FALSE; -- cgit v1.2.1