multiple displays: window working with
This commit is contained in:
parent
0f1b028fca
commit
400137930a
1 changed files with 6 additions and 18 deletions
24
wayland.c
24
wayland.c
|
|
@ -81,6 +81,8 @@ static void zwlr_layer_surface_v1_configure(void *data, struct zwlr_layer_surfac
|
||||||
wl_egl_window_resize(next->data.egl_window, width, height, 0, 0);
|
wl_egl_window_resize(next->data.egl_window, width, height, 0, 0);
|
||||||
zwlr_layer_surface_v1_ack_configure(zwlr_layer_surface_v1, serial);
|
zwlr_layer_surface_v1_ack_configure(zwlr_layer_surface_v1, serial);
|
||||||
printf("🐍🐍🐍🐍\n");
|
printf("🐍🐍🐍🐍\n");
|
||||||
|
// draw new frame!
|
||||||
|
next->data.dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void zwlr_layer_surface_v1_closed(void *data, struct zwlr_layer_surface_v1 * zwlr_layer_surface_v1) {
|
static void zwlr_layer_surface_v1_closed(void *data, struct zwlr_layer_surface_v1 * zwlr_layer_surface_v1) {
|
||||||
|
|
@ -107,23 +109,9 @@ wl_surface_frame_done(void *data, struct wl_callback *cb, uint32_t time) {
|
||||||
//struct client_state *state = surface->state;
|
//struct client_state *state = surface->state;
|
||||||
|
|
||||||
/* Request another frame */
|
/* Request another frame */
|
||||||
// TODO make sure this is done after the frame has been handled.
|
// TODO make sure this is done after the frame has been handled, maybe
|
||||||
//cb = wl_surface_frame(surface->wl_surface);
|
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);
|
||||||
|
|
||||||
///* Update scroll amount at 24 pixels per second */
|
|
||||||
//if (state->last_frame != 0) {
|
|
||||||
// int elapsed = time - state->last_frame;
|
|
||||||
// state->offset += elapsed / 1000.0 * 24;
|
|
||||||
//}
|
|
||||||
|
|
||||||
///* Submit a frame for this event */
|
|
||||||
//struct wl_buffer *buffer = draw_frame(state);
|
|
||||||
//wl_surface_attach(state->wl_surface, buffer, 0, 0);
|
|
||||||
//wl_surface_damage_buffer(state->wl_surface, 0, 0, INT32_MAX, INT32_MAX);
|
|
||||||
//wl_surface_commit(state->wl_surface);
|
|
||||||
|
|
||||||
//state->last_frame = time;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct wl_callback_listener wl_surface_frame_listener = {
|
static const struct wl_callback_listener wl_surface_frame_listener = {
|
||||||
|
|
@ -386,11 +374,11 @@ struct event wait_for_event(struct client_state *state) {
|
||||||
printf("checking for events\n");
|
printf("checking for events\n");
|
||||||
while (next != NULL) {
|
while (next != NULL) {
|
||||||
if (next->data.dirty) {
|
if (next->data.dirty) {
|
||||||
|
next->data.dirty = false;
|
||||||
printf("dirty\n");
|
printf("dirty\n");
|
||||||
|
|
||||||
if (eglMakeCurrent(state->egl_display, next->data.egl_surface,
|
if (eglMakeCurrent(state->egl_display, next->data.egl_surface,
|
||||||
next->data.egl_surface, state->egl_context)) {
|
next->data.egl_surface, state->egl_context)) {
|
||||||
fprintf(stderr, "Made current\n");
|
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Made current failed\n");
|
fprintf(stderr, "Made current failed\n");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue