From 95c708e0e0ff611e7256f07cba0932c6453ab8dd Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Wed, 30 Oct 2019 10:25:37 +0100 Subject: maximus-bind: avoid 'g_type_class_add_private' --- maximus/maximus-bind.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/maximus/maximus-bind.c b/maximus/maximus-bind.c index 2eadcea..9701bff 100644 --- a/maximus/maximus-bind.c +++ b/maximus/maximus-bind.c @@ -44,12 +44,6 @@ #include "tomboykeybinder.h" #include "eggaccelerators.h" -G_DEFINE_TYPE (MaximusBind, maximus_bind, G_TYPE_OBJECT); - -#define MAXIMUS_BIND_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj),\ - MAXIMUS_TYPE_BIND, \ - MaximusBindPrivate)) - #define KEY_RELEASE_TIMEOUT 300 #define STATE_CHANGED_SLEEP 0.5 @@ -83,6 +77,8 @@ typedef struct gchar *unfullscreen; } MaximusRule; +G_DEFINE_TYPE_WITH_PRIVATE (MaximusBind, maximus_bind, G_TYPE_OBJECT); + static const gchar * get_fullscreen_keystroke (GList *rules, WnckWindow *window) { @@ -455,8 +451,6 @@ maximus_bind_class_init (MaximusBindClass *klass) GObjectClass *obj_class = G_OBJECT_CLASS (klass); obj_class->finalize = maximus_bind_finalize; - - g_type_class_add_private (obj_class, sizeof (MaximusBindPrivate)); } static void @@ -466,7 +460,7 @@ maximus_bind_init (MaximusBind *bind) GdkDisplay *display = gdk_display_get_default (); WnckScreen *screen; - priv = bind->priv = MAXIMUS_BIND_GET_PRIVATE (bind); + priv = bind->priv = maximus_bind_get_instance_private (bind); priv->fk = fakekey_init (GDK_DISPLAY_XDISPLAY (display)); priv->screen = screen = wnck_screen_get_default (); -- cgit v1.2.1