summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2022-01-17 14:05:06 +0000
committerDaniel Stone <daniels@collabora.com>2022-03-31 17:15:55 +0000
commitd21563360a511e3d0434a8e87e23db83d85d8bb2 (patch)
treea8c0c7da36ba59831359e445ca2570724cff8a7a /shared
parent3a298b0b05c015682e4da129bed1bb85e5bb7a86 (diff)
downloadweston-d21563360a511e3d0434a8e87e23db83d85d8bb2.tar.gz
shell: Move weston_curtain_create params into the struct
Given that we have a struct for argument params, we might as well use it rather than have them split between the struct and native params. For consistency between the implementations, this also includes a shift from float to int positioning for the base offset within the compositor's global co-ordinate space. Signed-off-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'shared')
-rw-r--r--shared/shell-utils.c13
-rw-r--r--shared/shell-utils.h4
2 files changed, 9 insertions, 8 deletions
diff --git a/shared/shell-utils.c b/shared/shell-utils.c
index b4d93e43..51255a5b 100644
--- a/shared/shell-utils.c
+++ b/shared/shell-utils.c
@@ -140,8 +140,7 @@ surface_get_label(struct weston_surface *surface, char *buf, size_t len)
struct weston_view *
weston_curtain_create(struct weston_compositor *compositor,
- struct weston_curtain_params *params,
- float x, float y, int w, int h)
+ struct weston_curtain_params *params)
{
struct weston_surface *surface = NULL;
struct weston_view *view;
@@ -164,12 +163,14 @@ weston_curtain_create(struct weston_compositor *compositor,
weston_surface_set_color(surface, params->r, params->g, params->b, 1.0);
weston_surface_set_label_func(surface, params->get_label);
pixman_region32_fini(&surface->opaque);
- pixman_region32_init_rect(&surface->opaque, 0, 0, w, h);
+ pixman_region32_init_rect(&surface->opaque, 0, 0,
+ params->width, params->height);
pixman_region32_fini(&surface->input);
- pixman_region32_init_rect(&surface->input, 0, 0, w, h);
+ pixman_region32_init_rect(&surface->input, 0, 0,
+ params->width, params->height);
- weston_surface_set_size(surface, w, h);
- weston_view_set_position(view, x, y);
+ weston_surface_set_size(surface, params->width, params->height);
+ weston_view_set_position(view, params->x, params->y);
return view;
}
diff --git a/shared/shell-utils.h b/shared/shell-utils.h
index 9932957b..f8c508ff 100644
--- a/shared/shell-utils.h
+++ b/shared/shell-utils.h
@@ -32,6 +32,7 @@ struct weston_curtain_params {
void (*surface_committed)(struct weston_surface *es, int32_t sx, int32_t sy);
void *surface_private;
float r, g, b;
+ int x, y, width, height;
};
struct weston_output *
@@ -54,5 +55,4 @@ surface_get_label(struct weston_surface *surface, char *buf, size_t len);
*/
struct weston_view *
weston_curtain_create(struct weston_compositor *compositor,
- struct weston_curtain_params *ss,
- float x, float y, int w, int h);
+ struct weston_curtain_params *params);