[Spice-commits] server/red_worker.c

Yonit Halperin yhalperi at kemper.freedesktop.org
Mon Aug 30 09:24:27 PDT 2010


 server/red_worker.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit fbd874a464b739933947cdb3a54ab329ecf30a6f
Author: Yonit Halperin <yhalperi at redhat.com>
Date:   Mon Aug 30 13:38:16 2010 +0300

    server: fix red_current_flush to flush only the surface that was given as parameter
    
    A side effect of the previous red_current_flush, which flushed all the surfaces, and was called on a new display channel connection, was
    that red_handle_drawable_surfaces_client_synced sent the most updated surfaces images when needed. However, now, it should
    explicitly call red_current_flush.
    Moreover, since red_current_flush was called on a new display channel connection only if there was a primary surface,
    if the connection of the display channel occurred at the moment of no primary surface, red_handle_drawable_surfaces_client_synced was buggy.

diff --git a/server/red_worker.c b/server/red_worker.c
index 7576087..a11f428 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -1235,6 +1235,7 @@ static inline void red_handle_drawable_surfaces_client_synced(RedWorker *worker,
                 continue;
             }
             red_create_surface_item(worker, surface_id);
+            red_current_flush(worker, surface_id);
             red_add_surface_image(worker, surface_id);
         }
     }
@@ -1244,6 +1245,7 @@ static inline void red_handle_drawable_surfaces_client_synced(RedWorker *worker,
     }
 
     red_create_surface_item(worker, drawable->surface_id);
+    red_current_flush(worker, drawable->surface_id);
     red_add_surface_image(worker, drawable->surface_id);
 }
 
@@ -4417,7 +4419,7 @@ static void red_free_some(RedWorker *worker)
 
 static void red_current_flush(RedWorker *worker, int surface_id)
 {
-    while (!ring_is_empty(&worker->current_list)) {
+    while (!ring_is_empty(&worker->surfaces[surface_id].current_list)) {
         free_one_drawable(worker, FALSE);
     }
     red_current_clear(worker, surface_id);


More information about the Spice-commits mailing list