Recomposite screen in idle handler.

This commit is contained in:
Kristian Høgsberg 2008-10-11 19:21:35 -04:00
parent f921289954
commit 5ebb317383
5 changed files with 61 additions and 15 deletions

View file

@ -137,8 +137,9 @@ void notify_surface_attach(struct wl_compositor *compositor,
}
static void
repaint(struct egl_compositor *ec)
repaint(void *data)
{
struct egl_compositor *ec = data;
struct wl_surface_iterator *iterator;
struct wl_surface *surface;
struct surface_data *sd;
@ -197,13 +198,16 @@ void notify_surface_map(struct wl_compositor *compositor,
{
struct egl_compositor *ec = (struct egl_compositor *) compositor;
struct surface_data *sd;
struct wl_event_loop *loop;
sd = wl_surface_get_data(surface);
if (sd == NULL)
return;
sd->map = *map;
repaint(ec);
loop = wl_display_get_event_loop(ec->wl_display);
wl_event_loop_add_idle(loop, repaint, ec);
}
struct wl_compositor_interface interface = {