diff options
Diffstat (limited to 'src/backends/x11/nested/meta-backend-x11-nested.c')
-rw-r--r-- | src/backends/x11/nested/meta-backend-x11-nested.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/src/backends/x11/nested/meta-backend-x11-nested.c b/src/backends/x11/nested/meta-backend-x11-nested.c index 172c4d9ac..0f022aa76 100644 --- a/src/backends/x11/nested/meta-backend-x11-nested.c +++ b/src/backends/x11/nested/meta-backend-x11-nested.c @@ -28,8 +28,13 @@ #include "wayland/meta-wayland.h" -G_DEFINE_TYPE (MetaBackendX11Nested, meta_backend_x11_nested, - META_TYPE_BACKEND_X11) +typedef struct _MetaBackendX11NestedPrivate +{ + MetaGpu *gpu; +} MetaBackendX11NestedPrivate; + +G_DEFINE_TYPE_WITH_PRIVATE (MetaBackendX11Nested, meta_backend_x11_nested, + META_TYPE_BACKEND_X11) static MetaRenderer * meta_backend_x11_nested_create_renderer (MetaBackend *backend, @@ -183,6 +188,32 @@ meta_backend_x11_nested_translate_device_event (MetaBackendX11 *x11, } static void +meta_backend_x11_nested_real_init_gpus (MetaBackendX11Nested *backend_x11_nested) +{ + MetaBackendX11NestedPrivate *priv = + meta_backend_x11_nested_get_instance_private (backend_x11_nested); + + priv->gpu = g_object_new (META_TYPE_GPU_DUMMY, + "backend", backend_x11_nested, + NULL); + meta_backend_add_gpu (META_BACKEND (backend_x11_nested), priv->gpu); +} + +static void +meta_backend_x11_nested_constructed (GObject *object) +{ + MetaBackendX11Nested *backend_x11_nested = META_BACKEND_X11_NESTED (object); + MetaBackendX11NestedClass *backend_x11_nested_class = + META_BACKEND_X11_NESTED_GET_CLASS (backend_x11_nested); + GObjectClass *parent_class = + G_OBJECT_CLASS (meta_backend_x11_nested_parent_class); + + parent_class->constructed (object); + + backend_x11_nested_class->init_gpus (backend_x11_nested); +} + +static void meta_backend_x11_nested_init (MetaBackendX11Nested *backend_x11_nested) { } @@ -190,9 +221,12 @@ meta_backend_x11_nested_init (MetaBackendX11Nested *backend_x11_nested) static void meta_backend_x11_nested_class_init (MetaBackendX11NestedClass *klass) { + GObjectClass *object_class = G_OBJECT_CLASS (klass); MetaBackendClass *backend_class = META_BACKEND_CLASS (klass); MetaBackendX11Class *backend_x11_class = META_BACKEND_X11_CLASS (klass); + object_class->constructed = meta_backend_x11_nested_constructed; + backend_class->create_renderer = meta_backend_x11_nested_create_renderer; backend_class->create_monitor_manager = meta_backend_x11_nested_create_monitor_manager; backend_class->create_cursor_renderer = meta_backend_x11_nested_create_cursor_renderer; @@ -205,4 +239,6 @@ meta_backend_x11_nested_class_init (MetaBackendX11NestedClass *klass) backend_x11_class->handle_host_xevent = meta_backend_x11_nested_handle_host_xevent; backend_x11_class->translate_device_event = meta_backend_x11_nested_translate_device_event; + + klass->init_gpus = meta_backend_x11_nested_real_init_gpus; } |