summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2010-08-26 11:29:18 +0300
committerYonit Halperin <yhalperi@redhat.com>2010-08-30 10:11:47 +0300
commit1c8ec8f1cf956745ff8b33b67bc12e408ac7e075 (patch)
tree5a0b70e2b6a7901b35108470a2de1485d9528ccd /server
parent9ac9099842a7379a991a70627ddf6fe47462fc4a (diff)
downloadspice-1c8ec8f1cf956745ff8b33b67bc12e408ac7e075.tar.gz
spice-1c8ec8f1cf956745ff8b33b67bc12e408ac7e075.tar.xz
spice-1c8ec8f1cf956745ff8b33b67bc12e408ac7e075.zip
server: consider also PIPE_ITEM_UPGRADE when searching for drawables in red_clear_surface_drawables_from_pipe
Diffstat (limited to 'server')
-rw-r--r--server/red_worker.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/server/red_worker.c b/server/red_worker.c
index 173ee65c..e6a6c14d 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -1793,30 +1793,32 @@ static void red_clear_surface_drawables_from_pipe(RedWorker *worker, int surface
ring = &worker->display_channel->base.pipe;
item = (PipeItem *) ring;
while ((item = (PipeItem *)ring_next(ring, (RingItem *)item))) {
+ Drawable *drawable;
if (item->type == PIPE_ITEM_TYPE_DRAW) {
- PipeItem *tmp_item;
- Drawable *drawable;
-
drawable = SPICE_CONTAINEROF(item, Drawable, pipe_item);
+ } else if (item->type == PIPE_ITEM_TYPE_UPGRADE) {
+ drawable = ((UpgradeItem *)item)->drawable;
+ } else {
+ continue;
+ }
- for (x = 0; x < 3; ++x) {
- if (drawable->surfaces_dest[x] == surface_id) {
- return;
- }
+ for (x = 0; x < 3; ++x) {
+ if (drawable->surfaces_dest[x] == surface_id) {
+ return;
}
+ }
- if (drawable->surface_id == surface_id) {
- tmp_item = item;
- item = (PipeItem *)ring_prev(ring, (RingItem *)item);
- ring_remove(&tmp_item->link);
- release_drawable(worker, drawable);
- worker->display_channel->base.pipe_size--;
+ if (drawable->surface_id == surface_id) {
+ PipeItem *tmp_item = item;
+ item = (PipeItem *)ring_prev(ring, (RingItem *)item);
+ ring_remove(&tmp_item->link);
+ worker->display_channel->base.release_item(&worker->display_channel->base, tmp_item);
+ worker->display_channel->base.pipe_size--;
- if (!item) {
- item = (PipeItem *)ring;
- }
+ if (!item) {
+ item = (PipeItem *)ring;
}
- }
+ }
}
}