From d188949101b4b6328741645d15ebdd3274b1570d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 5 Dec 2016 18:33:19 +0800 Subject: [PATCH] backends/x11: Make the X11 backend derivable Make the X11 backend derivable so that we can base a nested test backend on it. https://bugzilla.gnome.org/show_bug.cgi?id=777732 --- src/backends/meta-monitor-manager-private.h | 2 ++ src/backends/x11/meta-backend-x11.c | 5 ----- src/backends/x11/meta-backend-x11.h | 9 +++++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/backends/meta-monitor-manager-private.h b/src/backends/meta-monitor-manager-private.h index 7e61d0e6b..332887037 100644 --- a/src/backends/meta-monitor-manager-private.h +++ b/src/backends/meta-monitor-manager-private.h @@ -278,6 +278,8 @@ struct _MetaOutputInfo { #define META_IS_MONITOR_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_MONITOR_MANAGER)) #define META_MONITOR_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_MONITOR_MANAGER, MetaMonitorManagerClass)) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MetaMonitorManager, g_object_unref) + struct _MetaMonitorManager { MetaDBusDisplayConfigSkeleton parent_instance; diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c index a54585914..9237f2703 100644 --- a/src/backends/x11/meta-backend-x11.c +++ b/src/backends/x11/meta-backend-x11.c @@ -55,11 +55,6 @@ #include "display-private.h" #include "compositor/compositor-private.h" -struct _MetaBackendX11 -{ - MetaBackend parent; -}; - typedef enum { /* We're a traditional CM running under the host. */ META_BACKEND_X11_MODE_COMPOSITOR, diff --git a/src/backends/x11/meta-backend-x11.h b/src/backends/x11/meta-backend-x11.h index b24e51851..8bb3388a0 100644 --- a/src/backends/x11/meta-backend-x11.h +++ b/src/backends/x11/meta-backend-x11.h @@ -32,8 +32,13 @@ #include "backends/x11/meta-clutter-backend-x11.h" #define META_TYPE_BACKEND_X11 (meta_backend_x11_get_type ()) -G_DECLARE_FINAL_TYPE (MetaBackendX11, meta_backend_x11, - META, BACKEND_X11, MetaBackend) +G_DECLARE_DERIVABLE_TYPE (MetaBackendX11, meta_backend_x11, + META, BACKEND_X11, MetaBackend) + +struct _MetaBackendX11Class +{ + MetaBackendClass parent_class; +}; Display * meta_backend_x11_get_xdisplay (MetaBackendX11 *backend);