[mutter/gbsneto/cleanup-x11-from-window-actor: 20/21] window-actor: Remove post_init() vfunc
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gbsneto/cleanup-x11-from-window-actor: 20/21] window-actor: Remove post_init() vfunc
- Date: Thu, 3 Jan 2019 18:20:42 +0000 (UTC)
commit 8c007e999b0f69fd88d4b8445f8c5f56b7cfdaef
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Jan 3 16:05:48 2019 -0200
window-actor: Remove post_init() vfunc
This vfunc was added as a was to work around the convoluted
initialization process. Now that we figured it out and moved
the MetaWindowActor-specific initialization to constructed(),
we can override that.
Remove post_init() and use GObject.constructed() entirely.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/368
src/compositor/meta-window-actor-private.h | 2 --
src/compositor/meta-window-actor-wayland.c | 6 ------
src/compositor/meta-window-actor-x11.c | 32 +++++++++++++++++-------------
src/compositor/meta-window-actor.c | 2 --
4 files changed, 18 insertions(+), 24 deletions(-)
---
diff --git a/src/compositor/meta-window-actor-private.h b/src/compositor/meta-window-actor-private.h
index 24f2c6f59..61651f16f 100644
--- a/src/compositor/meta-window-actor-private.h
+++ b/src/compositor/meta-window-actor-private.h
@@ -23,8 +23,6 @@ struct _MetaWindowActorClass
void (*queue_frame_drawn) (MetaWindowActor *actor,
gboolean skip_sync_delay);
- void (*post_init) (MetaWindowActor *actor);
-
void (*pre_paint) (MetaWindowActor *actor);
void (*post_paint) (MetaWindowActor *actor);
};
diff --git a/src/compositor/meta-window-actor-wayland.c b/src/compositor/meta-window-actor-wayland.c
index 5f5e83083..59b5c098e 100644
--- a/src/compositor/meta-window-actor-wayland.c
+++ b/src/compositor/meta-window-actor-wayland.c
@@ -54,11 +54,6 @@ meta_window_actor_wayland_queue_frame_drawn (MetaWindowActor *actor,
{
}
-static void
-meta_window_actor_wayland_post_init (MetaWindowActor *actor)
-{
-}
-
static void
meta_window_actor_wayland_pre_paint (MetaWindowActor *actor)
{
@@ -77,7 +72,6 @@ meta_window_actor_wayland_class_init (MetaWindowActorWaylandClass *klass)
window_actor_class->frame_complete = meta_window_actor_wayland_frame_complete;
window_actor_class->set_surface_actor = meta_window_actor_wayland_set_surface_actor;
window_actor_class->queue_frame_drawn = meta_window_actor_wayland_queue_frame_drawn;
- window_actor_class->post_init = meta_window_actor_wayland_post_init;
window_actor_class->pre_paint = meta_window_actor_wayland_pre_paint;
window_actor_class->post_paint = meta_window_actor_wayland_post_paint;
}
diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c
index 96338ff07..85c5d6551 100644
--- a/src/compositor/meta-window-actor-x11.c
+++ b/src/compositor/meta-window-actor-x11.c
@@ -413,19 +413,6 @@ meta_window_actor_x11_queue_frame_drawn (MetaWindowActor *actor,
}
}
-static void
-meta_window_actor_x11_post_init (MetaWindowActor *actor)
-{
- MetaWindow *window = meta_window_actor_get_meta_window (actor);
-
- /* If a window doesn't start off with updates frozen, we should
- * we should send a _NET_WM_FRAME_DRAWN immediately after the first drawn.
- */
- if (window->extended_sync_request_counter &&
- !meta_window_updates_are_frozen (window))
- meta_window_actor_queue_frame_drawn (actor, FALSE);
-}
-
static void
meta_window_actor_x11_pre_paint (MetaWindowActor *actor)
{
@@ -483,6 +470,23 @@ meta_window_actor_x11_paint (ClutterActor *actor)
CLUTTER_ACTOR_CLASS (meta_window_actor_x11_parent_class)->paint (actor);
}
+static void
+meta_window_actor_x11_constructed (GObject *object)
+{
+ MetaWindowActor *window_actor = META_WINDOW_ACTOR (object);
+ MetaWindow *window =
+ meta_window_actor_get_meta_window (window_actor);
+
+ G_OBJECT_CLASS (meta_window_actor_x11_parent_class)->constructed (object);
+
+ /* If a window doesn't start off with updates frozen, we should
+ * we should send a _NET_WM_FRAME_DRAWN immediately after the first drawn.
+ */
+ if (window->extended_sync_request_counter &&
+ !meta_window_updates_are_frozen (window))
+ meta_window_actor_queue_frame_drawn (window_actor, FALSE);
+}
+
static void
meta_window_actor_x11_dispose (GObject *object)
{
@@ -514,12 +518,12 @@ meta_window_actor_x11_class_init (MetaWindowActorX11Class *klass)
window_actor_class->frame_complete = meta_window_actor_x11_frame_complete;
window_actor_class->set_surface_actor = meta_window_actor_x11_set_surface_actor;
window_actor_class->queue_frame_drawn = meta_window_actor_x11_queue_frame_drawn;
- window_actor_class->post_init = meta_window_actor_x11_post_init;
window_actor_class->pre_paint = meta_window_actor_x11_pre_paint;
window_actor_class->post_paint = meta_window_actor_x11_post_paint;
actor_class->paint = meta_window_actor_x11_paint;
+ object_class->constructed = meta_window_actor_x11_constructed;
object_class->dispose = meta_window_actor_x11_dispose;
object_class->finalize = meta_window_actor_x11_finalize;
}
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index 2db65005b..e812128a7 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -433,8 +433,6 @@ meta_window_actor_constructed (GObject *object)
else
priv->first_frame_state = DRAWING_FIRST_FRAME;
- META_WINDOW_ACTOR_GET_CLASS (self)->post_init (self);
-
meta_window_actor_sync_actor_geometry (self, priv->window->placed);
/* Hang our compositor window state off the MetaWindow for fast retrieval */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]