Revert "backend-wayland: restructure wayland_output_resize_surface()"

This reverts commit 9e1c96bce7.
dev
Nikita Tokarchuk 2 months ago
parent 996dd5caa5
commit 419d6a9cf5
  1. 86
      libweston/backend-wayland/wayland.c

@ -831,54 +831,64 @@ wayland_output_init_pixman_renderer(struct wayland_output *output)
static void static void
wayland_output_resize_surface(struct wayland_output *output) wayland_output_resize_surface(struct wayland_output *output)
{ {
struct wayland_backend *b = to_wayland_backend(output->base.compositor); struct wayland_backend *b =
/* Defaults for without frame: */ to_wayland_backend(output->base.compositor);
struct weston_size fb_size = { int32_t ix, iy, iwidth, iheight;
.width = output->base.current_mode->width, int32_t width, height;
.height = output->base.current_mode->height
};
struct weston_geometry area = {
.x = 0,
.y = 0,
.width = fb_size.width,
.height = fb_size.height
};
struct weston_geometry inp = area;
struct weston_geometry opa = area;
struct wl_region *region; struct wl_region *region;
if (output->frame) { width = output->base.current_mode->width;
frame_resize_inside(output->frame, area.width, area.height); height = output->base.current_mode->height;
frame_interior(output->frame, &area.x, &area.y, NULL, NULL);
fb_size.width = frame_width(output->frame);
fb_size.height = frame_height(output->frame);
frame_input_rect(output->frame, &inp.x, &inp.y, if (output->frame) {
&inp.width, &inp.height); frame_resize_inside(output->frame, width, height);
frame_opaque_rect(output->frame, &opa.x, &opa.y,
&opa.width, &opa.height); frame_input_rect(output->frame, &ix, &iy, &iwidth, &iheight);
} region = wl_compositor_create_region(b->parent.compositor);
wl_region_add(region, ix, iy, iwidth, iheight);
wl_surface_set_input_region(output->parent.surface, region);
wl_region_destroy(region);
if (output->parent.xdg_surface) {
xdg_surface_set_window_geometry(output->parent.xdg_surface,
ix,
iy,
iwidth,
iheight);
}
region = wl_compositor_create_region(b->parent.compositor); frame_opaque_rect(output->frame, &ix, &iy, &iwidth, &iheight);
wl_region_add(region, inp.x, inp.y, inp.width, inp.height); region = wl_compositor_create_region(b->parent.compositor);
wl_surface_set_input_region(output->parent.surface, region); wl_region_add(region, ix, iy, iwidth, iheight);
wl_region_destroy(region); wl_surface_set_opaque_region(output->parent.surface, region);
wl_region_destroy(region);
if (output->parent.xdg_surface) { width = frame_width(output->frame);
xdg_surface_set_window_geometry(output->parent.xdg_surface, height = frame_height(output->frame);
inp.x, inp.y, } else {
inp.width, inp.height); region = wl_compositor_create_region(b->parent.compositor);
wl_region_add(region, 0, 0, width, height);
wl_surface_set_input_region(output->parent.surface, region);
wl_region_destroy(region);
region = wl_compositor_create_region(b->parent.compositor);
wl_region_add(region, 0, 0, width, height);
wl_surface_set_opaque_region(output->parent.surface, region);
wl_region_destroy(region);
if (output->parent.xdg_surface) {
xdg_surface_set_window_geometry(output->parent.xdg_surface,
0,
0,
width,
height);
}
} }
region = wl_compositor_create_region(b->parent.compositor);
wl_region_add(region, opa.x, opa.y, opa.width, opa.height);
wl_surface_set_opaque_region(output->parent.surface, region);
wl_region_destroy(region);
#ifdef ENABLE_EGL #ifdef ENABLE_EGL
if (output->gl.egl_window) { if (output->gl.egl_window) {
wl_egl_window_resize(output->gl.egl_window, wl_egl_window_resize(output->gl.egl_window,
fb_size.width, fb_size.height, 0, 0); width, height, 0, 0);
/* These will need to be re-created due to the resize */ /* These will need to be re-created due to the resize */
gl_renderer->output_set_border(&output->base, gl_renderer->output_set_border(&output->base,

Loading…
Cancel
Save