[mutter/gbsneto/cleanup-x11-from-window-actor: 2/3] window-actor: Remove post_init() vfunc



commit 5fbeecaac6002e9a702e7374e114ee271438d76b
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 714a49792..6333f43db 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);
   void (*queue_destroy) (MetaWindowActor *actor);
diff --git a/src/compositor/meta-window-actor-wayland.c b/src/compositor/meta-window-actor-wayland.c
index 7083d5507..7396f24eb 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)
 {
@@ -82,7 +77,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;
   window_actor_class->queue_destroy = meta_window_actor_wayland_queue_destroy;
diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c
index 32548898d..a364323fe 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)
 {
@@ -492,6 +479,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)
 {
@@ -523,13 +527,13 @@ 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;
   window_actor_class->queue_destroy = meta_window_actor_x11_queue_destroy;
 
   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 08bc88c57..b9b0485fb 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -431,8 +431,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]