diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2011-04-11 16:47:50 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2011-04-11 16:47:50 -0400 |
commit | 11e2828bdcf3ec4d59482a35fb510c51cc26acf6 (patch) | |
tree | c5dfb56f016b350f0a3e757701563c71240fc7de /clients | |
parent | 3555d09813cfe97ad2170bbb58655f7bb2aae7b0 (diff) | |
parent | ec4d342aa9b536c71bcf0d75249549860941793b (diff) |
Merge remote-tracking branch 'bnf/surface-frame-event'
Conflicts:
compositor/compositor.c
Diffstat (limited to 'clients')
-rw-r--r-- | clients/gears.c | 4 | ||||
-rw-r--r-- | clients/resizor.c | 7 | ||||
-rw-r--r-- | clients/simple-client.c | 9 | ||||
-rw-r--r-- | clients/smoke.c | 4 | ||||
-rw-r--r-- | clients/window.c | 6 | ||||
-rw-r--r-- | clients/window.h | 3 |
6 files changed, 25 insertions, 8 deletions
diff --git a/clients/gears.c b/clients/gears.c index fb5e117..3aaf8bb 100644 --- a/clients/gears.c +++ b/clients/gears.c @@ -295,7 +295,7 @@ redraw_handler(struct window *window, void *data) } static void -frame_callback(void *data, uint32_t time) +frame_callback(struct wl_surface *surface, void *data, uint32_t time) { struct gears *gears = data; @@ -303,6 +303,7 @@ frame_callback(void *data, uint32_t time) window_schedule_redraw(gears->window); wl_display_frame_callback(display_get_display(gears->d), + window_get_wl_surface(gears->window), frame_callback, gears); } @@ -363,6 +364,7 @@ gears_create(struct display *display) draw_gears(gears); wl_display_frame_callback(display_get_display(gears->d), + window_get_wl_surface(gears->window), frame_callback, gears); return gears; diff --git a/clients/resizor.c b/clients/resizor.c index 9788d25..16287b3 100644 --- a/clients/resizor.c +++ b/clients/resizor.c @@ -49,7 +49,7 @@ struct resizor { }; static void -frame_callback(void *data, uint32_t time) +frame_callback(struct wl_surface *surface, void *data, uint32_t time) { struct resizor *resizor = data; double force, height; @@ -107,6 +107,7 @@ resizor_draw(struct resizor *resizor) if (fabs(resizor->height.previous - resizor->height.target) > 0.1) { wl_display_frame_callback(display_get_display(resizor->display), + window_get_wl_surface(resizor->window), frame_callback, resizor); } } @@ -140,11 +141,11 @@ key_handler(struct window *window, struct input *input, uint32_t time, switch (sym) { case XK_Down: resizor->height.target = 400; - frame_callback(resizor, 0); + frame_callback(window_get_wl_surface(window), resizor, 0); break; case XK_Up: resizor->height.target = 200; - frame_callback(resizor, 0); + frame_callback(window_get_wl_surface(window), resizor, 0); break; } } diff --git a/clients/simple-client.c b/clients/simple-client.c index a64a482..e71ac21 100644 --- a/clients/simple-client.c +++ b/clients/simple-client.c @@ -217,7 +217,7 @@ create_surface(struct window *window) } static void -redraw(void *data, uint32_t time) +redraw(struct wl_surface *surface, void *data, uint32_t time) { struct window *window = data; static const GLfloat verts[3][2] = { @@ -268,7 +268,9 @@ redraw(void *data, uint32_t time) glFlush(); eglSwapBuffers(window->display->egl.dpy, window->egl_surface); - wl_display_frame_callback(window->display->display, redraw, window); + wl_display_frame_callback(window->display->display, + window->surface, + redraw, window); } static void @@ -316,7 +318,8 @@ main(int argc, char **argv) create_surface(&window); init_gl(&window); - wl_display_frame_callback(display.display, redraw, &window); + wl_display_frame_callback(display.display, window.surface, + redraw, &window); wl_display_get_fd(display.display, event_mask_update, &display); while (true) diff --git a/clients/smoke.c b/clients/smoke.c index e132229..1f22e59 100644 --- a/clients/smoke.c +++ b/clients/smoke.c @@ -173,7 +173,7 @@ static void render(struct smoke *smoke) } static void -frame_callback(void *data, uint32_t time) +frame_callback(struct wl_surface *surface, void *data, uint32_t time) { struct smoke *smoke = data; @@ -201,6 +201,7 @@ frame_callback(void *data, uint32_t time) window_damage(smoke->window, 0, 0, smoke->width, smoke->height); wl_display_frame_callback(display_get_display(smoke->display), + window_get_wl_surface(smoke->window), frame_callback, smoke); } @@ -288,6 +289,7 @@ int main(int argc, char *argv[]) window_set_user_data(smoke.window, &smoke); wl_display_frame_callback(display_get_display(d), + window_get_wl_surface(smoke.window), frame_callback, &smoke); display_run(d); diff --git a/clients/window.c b/clients/window.c index a51a5ab..cbe1454 100644 --- a/clients/window.c +++ b/clients/window.c @@ -913,6 +913,12 @@ window_get_surface(struct window *window) return cairo_surface_reference(window->cairo_surface); } +struct wl_surface * +window_get_wl_surface(struct window *window) +{ + return window->surface; +} + static int get_pointer_location(struct window *window, int32_t x, int32_t y) { diff --git a/clients/window.h b/clients/window.h index 85c9ad0..0e1ebd4 100644 --- a/clients/window.h +++ b/clients/window.h @@ -175,6 +175,9 @@ window_damage(struct window *window, int32_t x, int32_t y, cairo_surface_t * window_get_surface(struct window *window); +struct wl_surface * +window_get_wl_surface(struct window *window); + void window_flush(struct window *window); |