libweston: Position layers in an absolute way

Currently, layers’ order depends on the module loading order and it does
not survive runtime modifications (like shell locking/unlocking).
With this patch, modules can safely add their own layer at the expected
position in the stack, with runtime persistence.

v4 Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Acked-by: Daniel Stone <daniels@collabora.com>
[Pekka: fix three whitespace issues]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
Quentin Glidic
2016-12-17 13:40:51 +01:00
committed by Pekka Paalanen
parent 39d7e99a46
commit 82681571cf
10 changed files with 187 additions and 57 deletions
+3 -3
View File
@@ -116,8 +116,8 @@ show_input_panels(struct wl_listener *listener, void *data)
shell->showing_input_panels = true;
if (!shell->locked)
wl_list_insert(&shell->compositor->cursor_layer.link,
&shell->input_panel_layer.link);
weston_layer_set_position(&shell->input_panel_layer,
WESTON_LAYER_POSITION_TOP_UI);
wl_list_for_each_safe(ipsurf, next,
&shell->input_panel.surfaces, link) {
@@ -142,7 +142,7 @@ hide_input_panels(struct wl_listener *listener, void *data)
shell->showing_input_panels = false;
if (!shell->locked)
wl_list_remove(&shell->input_panel_layer.link);
weston_layer_unset_position(&shell->input_panel_layer);
wl_list_for_each_safe(view, next,
&shell->input_panel_layer.view_list.link,
+3 -1
View File
@@ -2019,7 +2019,9 @@ ivi_layout_init_with_compositor(struct weston_compositor *ec)
wl_signal_init(&layout->surface_notification.configure_changed);
/* Add layout_layer at the last of weston_compositor.layer_list */
weston_layer_init(&layout->layout_layer, ec->layer_list.prev);
weston_layer_init(&layout->layout_layer, ec);
weston_layer_set_position(&layout->layout_layer,
WESTON_LAYER_POSITION_NORMAL);
create_screen(ec);
+1 -1
View File
@@ -392,7 +392,7 @@ init_ivi_shell(struct weston_compositor *compositor, struct ivi_shell *shell,
wl_list_init(&shell->ivi_surface_list);
weston_layer_init(&shell->input_panel_layer, NULL);
weston_layer_init(&shell->input_panel_layer, compositor);
if (setting->developermode) {
weston_install_debug_key_binding(compositor, MODIFIER_SUPER);