both backgrounds animating when both in view
This commit is contained in:
parent
e934c1f61d
commit
c04ea2f9cc
2 changed files with 15 additions and 5 deletions
14
wayland.c
14
wayland.c
|
|
@ -101,12 +101,16 @@ static void
|
||||||
wl_surface_frame_done(void *data, struct wl_callback *cb, uint32_t time) {
|
wl_surface_frame_done(void *data, struct wl_callback *cb, uint32_t time) {
|
||||||
printf("FRAME CALLBACK 🐷🐷\n");
|
printf("FRAME CALLBACK 🐷🐷\n");
|
||||||
|
|
||||||
|
struct surface *surface = data;
|
||||||
|
struct client_state *state = surface->state;
|
||||||
|
|
||||||
/* Destroy this callback */
|
/* Destroy this callback */
|
||||||
wl_callback_destroy(cb);
|
wl_callback_destroy(cb);
|
||||||
|
|
||||||
struct surface *surface = data;
|
|
||||||
surface->dirty = true;
|
surface->dirty = true;
|
||||||
//struct client_state *state = surface->state;
|
|
||||||
|
// Don't make it stuck.
|
||||||
|
//wl_display_dispatch(state->wl_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct wl_callback_listener wl_surface_frame_listener = {
|
static const struct wl_callback_listener wl_surface_frame_listener = {
|
||||||
|
|
@ -377,7 +381,7 @@ struct event wait_for_event(struct client_state *state) {
|
||||||
// do here
|
// do here
|
||||||
if (next->data.dirty) {
|
if (next->data.dirty) {
|
||||||
next->data.dirty = false;
|
next->data.dirty = false;
|
||||||
state->surface_list->next = next->next;
|
state->surface_list_next = next->next;
|
||||||
|
|
||||||
printf("dirty %p\n", &next->data);
|
printf("dirty %p\n", &next->data);
|
||||||
|
|
||||||
|
|
@ -434,8 +438,8 @@ void swap_buffers(struct client_state *state, struct surface *surface) {
|
||||||
//wl_display_dispatch(state->wl_display);
|
//wl_display_dispatch(state->wl_display);
|
||||||
|
|
||||||
/* Request another frame */
|
/* Request another frame */
|
||||||
//struct wl_callback *cb = wl_surface_frame(surface->wl_surface);
|
struct wl_callback *cb = wl_surface_frame(surface->wl_surface);
|
||||||
//wl_callback_add_listener(cb, &wl_surface_frame_listener, surface);
|
wl_callback_add_listener(cb, &wl_surface_frame_listener, surface);
|
||||||
printf("done swapping\n");
|
printf("done swapping\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@
|
||||||
#define DEFAULT_WIDTH 400
|
#define DEFAULT_WIDTH 400
|
||||||
#define DEFAULT_HEIGHT 400
|
#define DEFAULT_HEIGHT 400
|
||||||
|
|
||||||
|
|
||||||
|
struct client_state;
|
||||||
|
|
||||||
struct surface {
|
struct surface {
|
||||||
int width, height;
|
int width, height;
|
||||||
|
|
||||||
|
|
@ -25,6 +28,9 @@ struct surface {
|
||||||
struct wl_output *wl_output;
|
struct wl_output *wl_output;
|
||||||
|
|
||||||
EGLSurface egl_surface;
|
EGLSurface egl_surface;
|
||||||
|
|
||||||
|
/// We need a back-pointer for callbacks.
|
||||||
|
struct client_state *state;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct surface_list {
|
struct surface_list {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue