shell: Make input capture optional for curtains

desktop-shell's focus surfaces want to reuse this, but they don't want
to capture the input, instead allowing it to fall through.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2022-01-18 18:59:33 +00:00
parent 64ef87554b
commit bd9b0676dd
4 changed files with 10 additions and 2 deletions

View File

@ -2092,6 +2092,7 @@ shell_ensure_fullscreen_black_view(struct shell_surface *shsurf)
.surface_committed = black_surface_committed,
.get_label = black_surface_get_label,
.surface_private = shsurf->view,
.capture_input = true,
};
assert(weston_desktop_surface_get_fullscreen(shsurf->desktop_surface));

View File

@ -508,6 +508,8 @@ kiosk_shell_output_recreate_background(struct kiosk_shell_output *shoutput)
curtain_params.width = output->width;
curtain_params.height = output->height;
curtain_params.capture_input = true;
curtain_params.get_label = kiosk_shell_background_surface_get_label;
curtain_params.surface_committed = NULL;
curtain_params.surface_private = NULL;

View File

@ -173,8 +173,12 @@ weston_curtain_create(struct weston_compositor *compositor,
}
pixman_region32_fini(&surface->input);
pixman_region32_init_rect(&surface->input, 0, 0,
params->width, params->height);
if (params->capture_input) {
pixman_region32_init_rect(&surface->input, 0, 0,
params->width, params->height);
} else {
pixman_region32_init(&surface->input);
}
weston_surface_set_size(surface, params->width, params->height);
weston_view_set_position(view, params->x, params->y);

View File

@ -33,6 +33,7 @@ struct weston_curtain_params {
void *surface_private;
float r, g, b, a;
int x, y, width, height;
bool capture_input;
};
struct weston_output *