Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement root_change #1091

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/backend/gl/egl.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ static void egl_diagnostics(backend_t *base) {
struct backend_operations egl_ops = {
.init = egl_init,
.deinit = egl_deinit,
.root_change = gl_root_change,
.bind_pixmap = egl_bind_pixmap,
.release_image = gl_release_image,
.prepare = gl_prepare,
Expand Down
5 changes: 5 additions & 0 deletions src/backend/gl/gl_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,11 @@ static bool gl_win_shader_from_stringv(const char **vshader_strv,
return true;
}

void gl_root_change(backend_t *base, session_t *ps) {
auto gd = (struct gl_data *)base;
gl_resize(gd, ps->root_width, ps->root_height);
}

/**
* Callback to run on root window size change.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/backend/gl/gl_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ bool gl_last_render_time(backend_t *backend_data, struct timespec *time);
void gl_compose(backend_t *, image_handle image, coord_t image_dst, image_handle mask,
coord_t mask_dst, const region_t *reg_tgt, const region_t *reg_visible);

void gl_root_change(backend_t *base, session_t *);

void gl_resize(struct gl_data *, int width, int height);

bool gl_init(struct gl_data *gd, session_t *);
Expand Down
1 change: 1 addition & 0 deletions src/backend/gl/glx.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ static void glx_diagnostics(backend_t *base) {
struct backend_operations glx_ops = {
.init = glx_init,
.deinit = glx_deinit,
.root_change = gl_root_change,
Monsterovich marked this conversation as resolved.
Show resolved Hide resolved
.bind_pixmap = glx_bind_pixmap,
.release_image = gl_release_image,
.prepare = gl_prepare,
Expand Down