summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2024-03-21 12:14:08 +0200
committerMarius Vlad <marius.vlad@collabora.com>2024-03-21 13:42:36 +0200
commitd9bf373abed69458ca6782f13df54b232ad6dcf7 (patch)
treecc82a29615f16061073db85dd644073bfbcc0499
parenta376c0b2237f1da8bb9912addd077fd9c45cae05 (diff)
layout, shell: Use implicit layer move to add views to layerssandbox/mvlad/fix-next
This afffects the background/panels and black curtain installment, with regular activation still using the older approach. Bug-AGL: SPEC-5096, SPEC-5061 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I7ba13c9ff7291c9b4f3b299c52fdf753a8d83081
-rw-r--r--src/layout.c16
-rw-r--r--src/shell.c25
2 files changed, 15 insertions, 26 deletions
diff --git a/src/layout.c b/src/layout.c
index 4c4ae6a..2c46d5f 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -69,6 +69,8 @@ ivi_background_init(struct ivi_compositor *ivi, struct ivi_output *output)
struct weston_output *woutput = output->output;
struct ivi_surface *bg = output->background;
struct weston_view *view;
+ struct weston_surface *wsurface =
+ weston_desktop_surface_get_surface(bg->dsurface);
if (!bg) {
weston_log("WARNING: Output does not have a background\n");
@@ -78,17 +80,15 @@ ivi_background_init(struct ivi_compositor *ivi, struct ivi_output *output)
assert(bg->role == IVI_SURFACE_ROLE_BACKGROUND);
view = bg->view;
+ weston_surface_map(wsurface);
weston_view_set_output(view, woutput);
weston_view_set_position(view, woutput->pos);
+ weston_view_move_to_layer(view, &ivi->background.view_list);
weston_log("(background) position view %p, x %f, y %f, on output %s\n", view,
woutput->pos.c.x, woutput->pos.c.y, output->name);
- view->is_mapped = true;
- view->surface->is_mapped = true;
-
- weston_layer_entry_insert(&ivi->background.view_list, &view->layer_link);
}
static void
@@ -137,16 +137,14 @@ ivi_panel_init(struct ivi_compositor *ivi, struct ivi_output *output,
weston_view_set_output(view, woutput);
weston_view_set_position(view, pos);
+
+ weston_view_move_to_layer(view, &ivi->panel.view_list);
+
weston_log("(panel) edge %d position view %p, x %f, y %f\n",
panel->panel.edge, view, pos.c.x, pos.c.y);
- view->is_mapped = true;
- view->surface->is_mapped = true;
-
weston_log("panel type %d inited on output %s\n", panel->panel.edge,
output->name);
-
- weston_layer_entry_insert(&ivi->panel.view_list, &view->layer_link);
}
/*
diff --git a/src/shell.c b/src/shell.c
index e9898a4..c29d89e 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1103,6 +1103,7 @@ void
remove_black_curtain(struct ivi_output *output)
{
struct weston_view *view;
+ struct weston_surface *wsurface;
if ((!output &&
!output->fullscreen_view.fs &&
@@ -1113,17 +1114,13 @@ remove_black_curtain(struct ivi_output *output)
}
view = output->fullscreen_view.fs->view;
+ wsurface = view->surface;
assert(view->is_mapped == true ||
view->surface->is_mapped == true);
- view->is_mapped = false;
- view->surface->is_mapped = false;
-
- weston_layer_entry_remove(&view->layer_link);
- weston_view_update_transform(view);
-
- weston_view_damage_below(view);
+ weston_surface_unmap(wsurface);
+ weston_view_move_to_layer(view, NULL);
weston_log("Removed black curtain from output %s\n", output->output->name);
}
@@ -1131,6 +1128,7 @@ void
insert_black_curtain(struct ivi_output *output)
{
struct weston_view *view;
+ struct weston_surface *wsurface;
if ((!output &&
!output->fullscreen_view.fs &&
@@ -1141,19 +1139,12 @@ insert_black_curtain(struct ivi_output *output)
}
view = output->fullscreen_view.fs->view;
+ wsurface = view->surface;
if (view->is_mapped || view->surface->is_mapped)
return;
- weston_layer_entry_remove(&view->layer_link);
- weston_layer_entry_insert(&output->ivi->fullscreen.view_list,
- &view->layer_link);
-
- view->is_mapped = true;
- view->surface->is_mapped = true;
-
- weston_view_update_transform(view);
- weston_view_damage_below(view);
-
+ weston_surface_map(wsurface);
+ weston_view_move_to_layer(view, &output->ivi->fullscreen.view_list);
weston_log("Added black curtain to output %s\n", output->output->name);
}