ivi-layout: add surface type to the surface properties

This makes it possible for the controller to distinguish different surface
types. For IVI and desktop surfaces, this is not all that useful, but it will be
needed for a new surface type: input panels.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This commit is contained in:
Michael Olbrich 2023-02-07 14:35:30 +01:00
parent 1c02bdfb8e
commit ad2c014ef3
2 changed files with 13 additions and 3 deletions

View File

@ -66,6 +66,11 @@ extern "C" {
struct ivi_layout_layer;
struct ivi_layout_surface;
enum ivi_layout_surface_type {
IVI_LAYOUT_SURFACE_TYPE_IVI,
IVI_LAYOUT_SURFACE_TYPE_DESKTOP,
};
struct ivi_layout_surface_properties
{
wl_fixed_t opacity;
@ -86,6 +91,7 @@ struct ivi_layout_surface_properties
int32_t transition_type;
uint32_t transition_duration;
uint32_t event_mask;
enum ivi_layout_surface_type surface_type;
};
struct ivi_layout_layer_properties

View File

@ -1961,7 +1961,8 @@ ivi_layout_surface_dump(struct weston_surface *surface,
*/
static struct ivi_layout_surface*
surface_create(struct weston_surface *wl_surface, uint32_t id_surface)
surface_create(struct weston_surface *wl_surface, uint32_t id_surface,
enum ivi_layout_surface_type surface_type)
{
struct ivi_layout *layout = get_instance();
struct ivi_layout_surface *ivisurf = NULL;
@ -1978,6 +1979,7 @@ surface_create(struct weston_surface *wl_surface, uint32_t id_surface)
ivisurf->surface->height_from_buffer = 0;
init_surface_properties(&ivisurf->prop);
ivisurf->prop.surface_type = surface_type;
ivisurf->pending.prop = ivisurf->prop;
@ -2007,7 +2009,8 @@ ivi_layout_desktop_surface_create(struct weston_surface *wl_surface,
struct ivi_layout *layout = get_instance();
struct ivi_layout_surface *ivisurf;
ivisurf = surface_create(wl_surface, IVI_INVALID_ID);
ivisurf = surface_create(wl_surface, IVI_INVALID_ID,
IVI_LAYOUT_SURFACE_TYPE_DESKTOP);
ivisurf->weston_desktop_surface = surface;
wl_signal_emit(&layout->surface_notification.created, ivisurf);
@ -2040,7 +2043,8 @@ ivi_layout_surface_create(struct weston_surface *wl_surface,
return NULL;
}
ivisurf = surface_create(wl_surface, id_surface);
ivisurf = surface_create(wl_surface, id_surface,
IVI_LAYOUT_SURFACE_TYPE_IVI);
if (ivisurf)
wl_signal_emit(&layout->surface_notification.created, ivisurf);