map/unmap surface in committing surface should be valid, only when buffer is newly attached. check if buffer is newly attached, when do map/unmap surface.

Summary:
There is a case that client do commit twice after one wl_surface_attach.
In this case, even if no buffer attached, unmapping the surface.
Because server already clear the buffer in first commit.

This patch fixes it.

Reviewers: devilhorns, zmike, raster

CC: cedric

Differential Revision: https://phab.enlightenment.org/D1115
This commit is contained in:
Seunghun Lee 2014-07-03 10:43:02 -04:00 committed by Chris Michael
parent b9caebbf7b
commit 6a1ef8b846
1 changed files with 15 additions and 12 deletions

View File

@ -359,22 +359,25 @@ _e_comp_wl_surface_cb_commit(struct wl_client *client EINA_UNUSED, struct wl_res
}
}
if (!ec->wl_comp_data->pending.buffer)
if (ec->wl_comp_data->pending.new_attach)
{
if (ec->wl_comp_data->mapped)
if (!ec->wl_comp_data->pending.buffer)
{
if ((ec->wl_comp_data->shell.surface) &&
(ec->wl_comp_data->shell.unmap))
ec->wl_comp_data->shell.unmap(ec->wl_comp_data->shell.surface);
if (ec->wl_comp_data->mapped)
{
if ((ec->wl_comp_data->shell.surface) &&
(ec->wl_comp_data->shell.unmap))
ec->wl_comp_data->shell.unmap(ec->wl_comp_data->shell.surface);
}
}
}
else
{
if (!ec->wl_comp_data->mapped)
else
{
if ((ec->wl_comp_data->shell.surface) &&
(ec->wl_comp_data->shell.map))
ec->wl_comp_data->shell.map(ec->wl_comp_data->shell.surface);
if (!ec->wl_comp_data->mapped)
{
if ((ec->wl_comp_data->shell.surface) &&
(ec->wl_comp_data->shell.map))
ec->wl_comp_data->shell.map(ec->wl_comp_data->shell.surface);
}
}
}