[mutter/foo: 2/3] compositor: Remove meta_compositor_window_[un]mapped



commit 1143474a31b9485168c7f8a894668be8bf58f933
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Dec 9 15:42:31 2013 -0500

    compositor: Remove meta_compositor_window_[un]mapped
    
    We no longer unmap the toplevel windows during normal operation. The
    toplevel state is tied to the window's lifetime.
    
    Call meta_compositor_add_window / meta_compositor_remove_window instead...

 doc/reference/meta-sections.txt    |    2 -
 src/compositor/compositor.c        |   33 -----------------------
 src/compositor/meta-window-actor.c |   51 ++---------------------------------
 src/core/window.c                  |   15 +---------
 src/meta/compositor.h              |   13 +++------
 5 files changed, 9 insertions(+), 105 deletions(-)
---
diff --git a/doc/reference/meta-sections.txt b/doc/reference/meta-sections.txt
index 7aa8931..22d4350 100644
--- a/doc/reference/meta-sections.txt
+++ b/doc/reference/meta-sections.txt
@@ -96,8 +96,6 @@ meta_compositor_hide_window
 meta_compositor_switch_workspace
 meta_compositor_maximize_window
 meta_compositor_unmaximize_window
-meta_compositor_window_mapped
-meta_compositor_window_unmapped
 meta_compositor_sync_window_geometry
 meta_compositor_set_updates_frozen
 meta_compositor_queue_frame_drawn
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index ef13188..f259ba2 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -42,15 +42,6 @@
  * the call, so it may be necessary to readjust the display based on the
  * old_rect to start the animation.
  *
- * meta_compositor_window_mapped() and meta_compositor_window_unmapped() are
- * notifications when the toplevel window (frame or client window) is mapped or
- * unmapped. That is, when the result of meta_window_toplevel_is_mapped()
- * changes. The main use of this is to drop resources when a window is unmapped.
- * A window will always be mapped before meta_compositor_show_window()
- * is called and will not be unmapped until after meta_compositor_hide_window()
- * is called. If the live_hidden_windows preference is set, windows will never
- * be unmapped.
- *
  * # Containers #
  *
  * There's two containers in the stage that are used to place window actors, here
@@ -1283,30 +1274,6 @@ meta_compositor_sync_stack (MetaCompositor  *compositor,
 }
 
 void
-meta_compositor_window_mapped (MetaCompositor *compositor,
-                               MetaWindow     *window)
-{
-  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
-  DEBUG_TRACE ("meta_compositor_window_mapped\n");
-  if (!window_actor)
-    return;
-
-  meta_window_actor_mapped (window_actor);
-}
-
-void
-meta_compositor_window_unmapped (MetaCompositor *compositor,
-                                 MetaWindow     *window)
-{
-  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
-  DEBUG_TRACE ("meta_compositor_window_unmapped\n");
-  if (!window_actor)
-    return;
-
-  meta_window_actor_unmapped (window_actor);
-}
-
-void
 meta_compositor_sync_window_geometry (MetaCompositor *compositor,
                                      MetaWindow *window,
                                       gboolean did_placement)
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index a2c05ca..285898e 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -109,7 +109,6 @@ struct _MetaWindowActorPrivate
   GList            *frames;
 
   guint                    visible                : 1;
-  guint                    mapped                 : 1;
   guint                    argb32                 : 1;
   guint                    disposed               : 1;
   guint             redecorating           : 1;
@@ -944,7 +943,7 @@ meta_window_actor_damage_all (MetaWindowActor *self)
 
   texture = meta_shaped_texture_get_texture (META_SHAPED_TEXTURE (priv->actor));
 
-  if (!priv->mapped || priv->needs_pixmap)
+  if (priv->needs_pixmap)
     return;
 
   redraw_queued = meta_shaped_texture_update_area (META_SHAPED_TEXTURE (priv->actor),
@@ -1033,7 +1032,7 @@ meta_window_actor_queue_frame_drawn (MetaWindowActor *self,
         {
           queue_send_frame_messages_timeout (self);
         }
-      else if (priv->mapped && !priv->needs_pixmap)
+      else
         {
           const cairo_rectangle_int_t clip = { 0, 0, 1, 1 };
           clutter_actor_queue_redraw_with_clip (priv->actor, &clip);
@@ -1065,9 +1064,6 @@ meta_window_actor_queue_create_pixmap (MetaWindowActor *self)
 
   priv->needs_pixmap = TRUE;
 
-  if (!priv->mapped)
-    return;
-
   if (is_frozen (self))
     return;
 
@@ -1577,10 +1573,6 @@ meta_window_actor_new (MetaWindow *window)
   priv->last_width = -1;
   priv->last_height = -1;
 
-  priv->mapped = meta_window_toplevel_is_mapped (priv->window);
-  if (priv->mapped)
-    meta_window_actor_queue_create_pixmap (self);
-
   meta_window_actor_set_updates_frozen (self,
                                         meta_window_updates_are_frozen (priv->window));
 
@@ -1614,34 +1606,6 @@ meta_window_actor_new (MetaWindow *window)
   return self;
 }
 
-void
-meta_window_actor_mapped (MetaWindowActor *self)
-{
-  MetaWindowActorPrivate *priv = self->priv;
-
-  g_return_if_fail (!priv->mapped);
-
-  priv->mapped = TRUE;
-
-  meta_window_actor_queue_create_pixmap (self);
-}
-
-void
-meta_window_actor_unmapped (MetaWindowActor *self)
-{
-  MetaWindowActorPrivate *priv = self->priv;
-
-  g_return_if_fail (priv->mapped);
-
-  priv->mapped = FALSE;
-
-  if (meta_window_actor_effect_in_progress (self))
-    return;
-
-  meta_window_actor_detach (self);
-  priv->needs_pixmap = FALSE;
-}
-
 /**
  * meta_window_actor_get_obscured_region:
  * @self: a #MetaWindowActor
@@ -1844,9 +1808,6 @@ check_needs_pixmap (MetaWindowActor *self)
   if (!priv->needs_pixmap)
     return;
 
-  if (!priv->mapped)
-    return;
-
   if (xwindow == meta_screen_get_xroot (screen) ||
       xwindow == clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage)))
     return;
@@ -1932,9 +1893,6 @@ check_needs_shadow (MetaWindowActor *self)
   gboolean should_have_shadow;
   gboolean appears_focused;
 
-  if (!priv->mapped)
-    return;
-
   /* Calling meta_window_actor_has_shadow() here at every pre-paint is cheap
    * and avoids the need to explicitly handle window type changes, which
    * we would do if tried to keep track of when we might be adding or removing
@@ -2038,7 +1996,7 @@ meta_window_actor_process_damage (MetaWindowActor    *self,
       return;
     }
 
-  if (!priv->mapped || priv->needs_pixmap)
+  if (priv->needs_pixmap)
     return;
 
   redraw_queued = meta_shaped_texture_update_area (META_SHAPED_TEXTURE (priv->actor),
@@ -2307,9 +2265,6 @@ check_needs_reshape (MetaWindowActor *self)
   MetaFrameBorders borders;
   cairo_rectangle_int_t client_area;
 
-  if (!priv->mapped)
-    return;
-
   if (!priv->needs_reshape)
     return;
 
diff --git a/src/core/window.c b/src/core/window.c
index 871f0e2..84e506c 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -1401,9 +1401,6 @@ meta_window_new (MetaDisplay   *display,
       set_net_wm_state (window);
     }
 
-  if (screen->display->compositor)
-    meta_compositor_add_window (screen->display->compositor, window);
-
   /* Sync stack changes */
   meta_stack_thaw (window->screen->stack);
 
@@ -1629,8 +1626,6 @@ meta_window_unmanage (MetaWindow  *window,
       if (window->visible_to_compositor)
         meta_compositor_hide_window (window->display->compositor, window,
                                      META_COMP_EFFECT_DESTROY);
-
-      meta_compositor_remove_window (window->display->compositor, window);
     }
 
   if (window->display->window_with_menu == window)
@@ -3093,7 +3088,7 @@ meta_window_show (MetaWindow *window)
   if (toplevel_now_mapped != toplevel_was_mapped)
     {
       if (window->display->compositor)
-        meta_compositor_window_mapped (window->display->compositor, window);
+        meta_compositor_add_window (window->display->compositor, window);
     }
 
   if (!window->visible_to_compositor)
@@ -3242,13 +3237,7 @@ meta_window_hide (MetaWindow *window)
   if (toplevel_now_mapped != toplevel_was_mapped)
     {
       if (window->display->compositor)
-        {
-          /* As above, we may be *mapping* live hidden windows */
-          if (toplevel_now_mapped)
-            meta_compositor_window_mapped (window->display->compositor, window);
-          else
-            meta_compositor_window_unmapped (window->display->compositor, window);
-        }
+        meta_compositor_remove_window (window->display->compositor, window);
     }
 
   set_net_wm_state (window);
diff --git a/src/meta/compositor.h b/src/meta/compositor.h
index b0e5455..f3f2a7d 100644
--- a/src/meta/compositor.h
+++ b/src/meta/compositor.h
@@ -77,11 +77,10 @@ gboolean meta_compositor_filter_keybinding (MetaCompositor *compositor,
                                             MetaScreen     *screen,
                                             MetaKeyBinding *binding);
 
-void meta_compositor_add_window    (MetaCompositor *compositor,
-                                    MetaWindow     *window);
-void meta_compositor_remove_window (MetaCompositor *compositor,
-                                    MetaWindow     *window);
-
+void meta_compositor_add_window        (MetaCompositor      *compositor,
+                                        MetaWindow          *window);
+void meta_compositor_remove_window     (MetaCompositor      *compositor,
+                                        MetaWindow          *window);
 void meta_compositor_show_window       (MetaCompositor      *compositor,
                                         MetaWindow          *window,
                                         MetaCompEffect       effect);
@@ -103,10 +102,6 @@ void meta_compositor_unmaximize_window (MetaCompositor      *compositor,
                                         MetaRectangle       *old_rect,
                                         MetaRectangle       *new_rect);
 
-void meta_compositor_window_mapped        (MetaCompositor *compositor,
-                                           MetaWindow     *window);
-void meta_compositor_window_unmapped      (MetaCompositor *compositor,
-                                           MetaWindow     *window);
 void meta_compositor_sync_window_geometry (MetaCompositor *compositor,
                                            MetaWindow     *window,
                                            gboolean        did_placement);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]