mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 21:05:58 +01:00
Add new interfaces to wayland backend
This commit is contained in:
parent
038dfdbc85
commit
97213cc00e
1 changed files with 21 additions and 14 deletions
|
@ -15,29 +15,34 @@ static void surface_frame_callback(void *data, struct wl_callback *cb, uint32_t
|
||||||
struct wlr_output_state *output = data;
|
struct wlr_output_state *output = data;
|
||||||
assert(output);
|
assert(output);
|
||||||
|
|
||||||
if (!eglMakeCurrent(output->backend->egl.display,
|
wlr_log(L_DEBUG, "frame_callback");
|
||||||
output->egl_surface, output->egl_surface,
|
|
||||||
output->backend->egl.context)) {
|
|
||||||
wlr_log(L_ERROR, "eglMakeCurrent failed: %s", egl_error());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct wlr_output *wlr_output = output->wlr_output;
|
struct wlr_output *wlr_output = output->wlr_output;
|
||||||
wl_signal_emit(&wlr_output->events.frame, wlr_output);
|
wl_signal_emit(&wlr_output->events.frame, wlr_output);
|
||||||
output->frame_callback = wl_surface_frame(output->surface);
|
|
||||||
wl_callback_add_listener(output->frame_callback, &frame_listener, output);
|
|
||||||
wl_callback_destroy(cb);
|
wl_callback_destroy(cb);
|
||||||
|
|
||||||
if (!eglSwapBuffers(output->backend->egl.display, output->egl_surface)) {
|
|
||||||
wlr_log(L_ERROR, "eglSwapBuffers failed: %s", egl_error());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct wl_callback_listener frame_listener = {
|
static struct wl_callback_listener frame_listener = {
|
||||||
.done = surface_frame_callback
|
.done = surface_frame_callback
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void wlr_wl_output_make_current(struct wlr_output_state *output) {
|
||||||
|
wlr_log(L_DEBUG, "make_current");
|
||||||
|
if (!eglMakeCurrent(output->backend->egl.display,
|
||||||
|
output->egl_surface, output->egl_surface,
|
||||||
|
output->backend->egl.context)) {
|
||||||
|
wlr_log(L_ERROR, "eglMakeCurrent failed: %s", egl_error());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void wlr_wl_output_swap_buffers(struct wlr_output_state *output) {
|
||||||
|
wlr_log(L_DEBUG, "swap_buffers");
|
||||||
|
output->frame_callback = wl_surface_frame(output->surface);
|
||||||
|
wl_callback_add_listener(output->frame_callback, &frame_listener, output);
|
||||||
|
if (!eglSwapBuffers(output->backend->egl.display, output->egl_surface)) {
|
||||||
|
wlr_log(L_ERROR, "eglSwapBuffers failed: %s", egl_error());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void wlr_wl_output_transform(struct wlr_output_state *output,
|
static void wlr_wl_output_transform(struct wlr_output_state *output,
|
||||||
enum wl_output_transform transform) {
|
enum wl_output_transform transform) {
|
||||||
output->wlr_output->transform = transform;
|
output->wlr_output->transform = transform;
|
||||||
|
@ -55,6 +60,8 @@ static void wlr_wl_output_destroy(struct wlr_output_state *output) {
|
||||||
static struct wlr_output_impl output_impl = {
|
static struct wlr_output_impl output_impl = {
|
||||||
.transform = wlr_wl_output_transform,
|
.transform = wlr_wl_output_transform,
|
||||||
.destroy = wlr_wl_output_destroy,
|
.destroy = wlr_wl_output_destroy,
|
||||||
|
.make_current = wlr_wl_output_make_current,
|
||||||
|
.swap_buffers = wlr_wl_output_swap_buffers,
|
||||||
};
|
};
|
||||||
|
|
||||||
void handle_ping(void* data, struct wl_shell_surface* ssurface, uint32_t serial) {
|
void handle_ping(void* data, struct wl_shell_surface* ssurface, uint32_t serial) {
|
||||||
|
|
Loading…
Reference in a new issue