[mutter] Always send _NET_WM_FRAME_DRAWN for newly created windows



commit 6e02fb80c4f9de577edaacae6632669e10f26746
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu Feb 28 16:12:50 2013 -0500

    Always send _NET_WM_FRAME_DRAWN for newly created windows
    
    Send a _NET_WM_FRAME_DRAWN for each newly created window, as required
    by the specification. This avoids a race where a window might be created
    frozen but already unfrozen by the time we first see fetch the
    counter value.
    
    Remove a duplicate call to meta_compositor_set_updates_frozen() which
    was called before the MetaWindowActor is created and hence did nothing.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694771

 src/compositor/meta-window-actor.c |    7 ++++++-
 src/core/window.c                  |    4 ----
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index fbdb72d..f54b87f 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -1562,6 +1562,12 @@ meta_window_actor_new (MetaWindow *window)
   meta_window_actor_set_updates_frozen (self,
                                         meta_window_updates_are_frozen (priv->window));
 
+  /* 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 (priv->window->extended_sync_request_counter && !priv->updates_frozen)
+    meta_window_actor_queue_frame_drawn (self, FALSE);
+
   meta_window_actor_sync_actor_geometry (self, priv->window->placed);
 
   /* Hang our compositor window state off the MetaWindow for fast retrieval */
@@ -2408,7 +2414,6 @@ meta_window_actor_post_paint (MetaWindowActor *self)
 
       frame->frame_drawn_time = meta_compositor_monotonic_time_to_server_time (display,
                                                                                g_get_monotonic_time ());
-
       ev.type = ClientMessage;
       ev.window = meta_window_get_xwindow (priv->window);
       ev.message_type = display->atom__NET_WM_FRAME_DRAWN;
diff --git a/src/core/window.c b/src/core/window.c
index bcc1fa3..caadfb7 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -4558,10 +4558,6 @@ meta_window_create_sync_request_alarm (MetaWindow *window)
 
       window->sync_request_serial =
         XSyncValueLow32 (init) + ((gint64)XSyncValueHigh32 (init) << 32);
-
-      /* if the value is odd, the window starts off with updates frozen */
-      meta_compositor_set_updates_frozen (window->display->compositor, window,
-                                          meta_window_updates_are_frozen (window));
     }
   else
     {


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