summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-09-05 02:54:04 +0200
committerVictor Kareh <[email protected]>2019-10-02 06:48:58 -0400
commit86cb5f8a9802686be8966dc036098454412f74d3 (patch)
treeaa5da47ca0c00d28cf4e33b2eccfd209594667bc /src
parent7ceb9c9ab46ba65b488e501b248678652c56dc2e (diff)
downloadmate-screensaver-86cb5f8a9802686be8966dc036098454412f74d3.tar.bz2
mate-screensaver-86cb5f8a9802686be8966dc036098454412f74d3.tar.xz
gs-grab-x11: avoid 'g_type_class_add_private'
Diffstat (limited to 'src')
-rw-r--r--src/gs-grab-x11.c10
1 files 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;