f0a25efcd066d661f6d55d280bae7305dff28163
[AGL/meta-agl-demo.git] / recipes-graphics / wayland / weston / 0002-ivi-shell-avoid-inserting-a-ivi_layer-to-multiple-sc.patch
1 From 46969606558dc378042de125fa85efa6a658aa18 Mon Sep 17 00:00:00 2001
2 From: Koji Ohira <kk.ohira.koji@nttd-mse.com>
3 Date: Thu, 24 Nov 2016 21:04:43 +0900
4 Subject: [PATCH] ivi-shell: avoid inserting a ivi_layer to multiple screens.
5
6 In just previous wl_list_for_each_safe, list of layer in a screen is
7 cleaned up. And then, the list is re-constructed from
8 pending.layer_list.
9
10 In this re-construction, if order.link of a layer were inserted into a
11 screen whose number is later one of current screen, the order.link will
12 inserted into layer_list of two screens. This shall be avoided.
13
14 However, if we want to implement a feature to allow a layer to be added
15 to multiple screens. A layer shall have several order.link per screens.
16 So, I marked here as TODO.
17
18 Signed-off-by: Koji Ohira <kk.ohira.koji@nttd-mse.com>
19 ---
20  ivi-shell/ivi-layout.c | 3 +++
21  1 file changed, 3 insertions(+)
22
23 diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
24 index efc0da5..1139590 100644
25 --- a/ivi-shell/ivi-layout.c
26 +++ b/ivi-shell/ivi-layout.c
27 @@ -974,6 +974,9 @@ commit_screen_list(struct ivi_layout *layout)
28  
29                         wl_list_for_each(ivilayer, &iviscrn->pending.layer_list,
30                                          pending.link) {
31 +                               /* FIXME: avoid to insert order.link to multiple screens */
32 +                               wl_list_remove(&ivilayer->order.link);
33 +
34                                 wl_list_insert(&iviscrn->order.layer_list,
35                                                &ivilayer->order.link);
36                                 add_orderlayer_to_screen(ivilayer, iviscrn);
37 -- 
38 2.7.4
39