[mutter/wip/gbsneto/kms-transactions-on-steroids: 1/30] backends/native: Remove instance private
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/gbsneto/kms-transactions-on-steroids: 1/30] backends/native: Remove instance private
- Date: Thu, 20 Jun 2019 13:07:35 +0000 (UTC)
commit fc87b6137c83942343e51f0153c9622778083653
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Thu Sep 6 14:14:59 2018 +0200
backends/native: Remove instance private
The object struct definition itself is private, so the object instance
private serves no purpose. Thus, move the fields into the object struct
and remove the instance private struct.
https://gitlab.gnome.org/GNOME/mutter/issues/548
https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
src/backends/native/meta-backend-native.c | 32 ++++++++-----------------------
1 file changed, 8 insertions(+), 24 deletions(-)
---
diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c
index 6f21f9c2c..e4e9be225 100644
--- a/src/backends/native/meta-backend-native.c
+++ b/src/backends/native/meta-backend-native.c
@@ -62,14 +62,10 @@
struct _MetaBackendNative
{
MetaBackend parent;
-};
-struct _MetaBackendNativePrivate
-{
MetaLauncher *launcher;
MetaBarrierManagerNative *barrier_manager;
};
-typedef struct _MetaBackendNativePrivate MetaBackendNativePrivate;
static GInitableIface *initable_parent_iface;
@@ -77,7 +73,6 @@ static void
initable_iface_init (GInitableIface *initable_iface);
G_DEFINE_TYPE_WITH_CODE (MetaBackendNative, meta_backend_native, META_TYPE_BACKEND,
- G_ADD_PRIVATE (MetaBackendNative)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
initable_iface_init))
@@ -85,9 +80,8 @@ static void
meta_backend_native_finalize (GObject *object)
{
MetaBackendNative *native = META_BACKEND_NATIVE (object);
- MetaBackendNativePrivate *priv = meta_backend_native_get_instance_private (native);
- meta_launcher_free (priv->launcher);
+ meta_launcher_free (native->launcher);
G_OBJECT_CLASS (meta_backend_native_parent_class)->finalize (object);
}
@@ -99,10 +93,8 @@ constrain_to_barriers (ClutterInputDevice *device,
float *new_y)
{
MetaBackendNative *native = META_BACKEND_NATIVE (meta_get_backend ());
- MetaBackendNativePrivate *priv =
- meta_backend_native_get_instance_private (native);
- meta_barrier_manager_native_process (priv->barrier_manager,
+ meta_barrier_manager_native_process (native->barrier_manager,
device,
time,
new_x, new_y);
@@ -575,26 +567,22 @@ meta_backend_native_class_init (MetaBackendNativeClass *klass)
static void
meta_backend_native_init (MetaBackendNative *native)
{
- MetaBackendNativePrivate *priv = meta_backend_native_get_instance_private (native);
GError *error = NULL;
- priv->launcher = meta_launcher_new (&error);
- if (priv->launcher == NULL)
+ native->launcher = meta_launcher_new (&error);
+ if (native->launcher == NULL)
{
g_warning ("Can't initialize KMS backend: %s\n", error->message);
exit (1);
}
- priv->barrier_manager = meta_barrier_manager_native_new ();
+ native->barrier_manager = meta_barrier_manager_native_new ();
}
MetaLauncher *
meta_backend_native_get_launcher (MetaBackendNative *native)
{
- MetaBackendNativePrivate *priv =
- meta_backend_native_get_instance_private (native);
-
- return priv->launcher;
+ return native->launcher;
}
gboolean
@@ -610,10 +598,7 @@ meta_activate_vt (int vt, GError **error)
MetaBarrierManagerNative *
meta_backend_native_get_barrier_manager (MetaBackendNative *native)
{
- MetaBackendNativePrivate *priv =
- meta_backend_native_get_instance_private (native);
-
- return priv->barrier_manager;
+ return native->barrier_manager;
}
/**
@@ -634,9 +619,8 @@ meta_activate_session (void)
return TRUE;
MetaBackendNative *native = META_BACKEND_NATIVE (backend);
- MetaBackendNativePrivate *priv = meta_backend_native_get_instance_private (native);
- if (!meta_launcher_activate_session (priv->launcher, &error))
+ if (!meta_launcher_activate_session (native->launcher, &error))
{
g_warning ("Could not activate session: %s\n", error->message);
g_error_free (error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]