shell-utils: Use weston_coord in curtain params

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2022-09-06 07:50:53 -05:00 committed by Marius Vlad
parent 7dfc209824
commit d62c1b7f7b
7 changed files with 14 additions and 17 deletions

View File

@ -643,7 +643,7 @@ create_focus_surface(struct weston_compositor *ec,
struct focus_surface *fsurf = NULL;
struct weston_curtain_params curtain_params = {
.r = 0.0, .g = 0.0, .b = 0.0, .a = 1.0,
.x = output->pos.c.x, .y = output->pos.c.y,
.pos = output->pos,
.width = output->width, .height = output->height,
.surface_committed = focus_surface_committed,
.get_label = focus_surface_get_label,
@ -1917,7 +1917,7 @@ shell_set_view_fullscreen(struct shell_surface *shsurf)
struct weston_output *output = shsurf->fullscreen_output;
struct weston_curtain_params curtain_params = {
.r = 0.0, .g = 0.0, .b = 0.0, .a = 1.0,
.x = output->pos.c.x, .y = output->pos.c.y,
.pos = output->pos,
.width = output->width, .height = output->height,
.surface_committed = black_surface_committed,
.get_label = black_surface_get_label,
@ -3897,8 +3897,6 @@ shell_fade_create_view(struct desktop_shell *shell)
struct shell_output *shell_output;
struct weston_curtain_params curtain_params = {
.r = 0.0, .g = 0.0, .b = 0.0, .a = 1.0,
.x = 0, .y = 0,
.width = 8192, .height = 8192,
.surface_committed = black_surface_committed,
.get_label = fade_surface_get_label,
.surface_private = shell,
@ -3925,8 +3923,8 @@ shell_fade_create_view(struct desktop_shell *shell)
x2 = MAX(x2, op->pos.c.x + op->width);
y2 = MAX(y2, op->pos.c.y + op->height);
}
curtain_params.x = x1;
curtain_params.y = y1;
curtain_params.pos.c.x = x1;
curtain_params.pos.c.y = y1;
curtain_params.width = x2 - x1;
curtain_params.height = y2 - y1;
curtain = weston_shell_utils_curtain_create(compositor, &curtain_params);

View File

@ -228,11 +228,11 @@ black_surface_committed(struct weston_surface *es,
static struct weston_curtain *
create_curtain(struct weston_compositor *ec, struct fs_output *fsout,
float x, float y, int w, int h)
struct weston_coord_global pos, int w, int h)
{
struct weston_curtain_params curtain_params = {
.r = 0.0, .g = 0.0, .b = 0.0, .a = 1.0,
.x = x, .y = y, .width = w, .height = h,
.pos = pos, .width = w, .height = h,
.surface_committed = black_surface_committed,
.get_label = NULL,
.surface_private = fsout,
@ -324,7 +324,7 @@ fs_output_create(struct fullscreen_shell *shell, struct weston_output *output)
fsout->surface_destroyed.notify = surface_destroyed;
fsout->pending.surface_destroyed.notify = pending_surface_destroyed;
fsout->curtain = create_curtain(shell->compositor, fsout,
output->pos.c.x, output->pos.c.y,
output->pos,
output->width, output->height);
fsout->curtain->view->is_mapped = true;
weston_layer_entry_insert(&shell->layer.view_list,

View File

@ -36,7 +36,8 @@ struct weston_curtain_params {
struct weston_coord_surface new_origin);
void *surface_private;
float r, g, b, a;
int x, y, width, height;
struct weston_coord_global pos;
int width, height;
bool capture_input;
};

View File

@ -634,8 +634,7 @@ kiosk_shell_output_recreate_background(struct kiosk_shell_output *shoutput)
curtain_params.b = ((bg_color >> 0) & 0xff) / 255.0;
curtain_params.a = 1.0;
curtain_params.x = output->pos.c.x;
curtain_params.y = output->pos.c.y;
curtain_params.pos = output->pos;
curtain_params.width = output->width;
curtain_params.height = output->height;

View File

@ -180,7 +180,6 @@ weston_shell_utils_curtain_create(struct weston_compositor *compositor,
struct weston_surface *surface = NULL;
struct weston_buffer_reference *buffer_ref;
struct weston_view *view;
struct weston_coord_global pos;
curtain = zalloc(sizeof(*curtain));
if (curtain == NULL)
@ -222,8 +221,7 @@ weston_shell_utils_curtain_create(struct weston_compositor *compositor,
weston_surface_map(surface);
pos.c = weston_coord(params->x, params->y);
weston_view_set_position(view, pos);
weston_view_set_position(view, params->pos);
return curtain;

View File

@ -81,7 +81,7 @@ output_create_view(struct test_output *t_output)
{
struct weston_curtain_params curtain_params = {
.r = 0.5, .g = 0.5, .b = 0.5, .a = 1.0,
.x = 0, .y = 0,
.pos.c = weston_coord(0, 0),
.width = 320, .height = 240,
.get_label = NULL,
.surface_committed = NULL,

View File

@ -217,7 +217,8 @@ wet_shell_init(struct weston_compositor *ec,
struct desktest_shell *dts;
struct weston_curtain_params background_params = {
.r = 0.16, .g = 0.32, .b = 0.48, .a = 1.0,
.x = 0, .y = 0, .width = 2000, .height = 2000,
.pos.c = weston_coord(0, 0),
.width = 2000, .height = 2000,
.capture_input = true,
.surface_committed = NULL,
.get_label = background_get_label,