ivi-shell multi screen support
[AGL/meta-agl-demo.git] / recipes-graphics / wayland / weston / 0005-ivi-shell-multi-screen-support.-ivi_layout_screen-to.patch
1 From e8bfcbd7e64a296d2aba63a80d8e181055587f76 Mon Sep 17 00:00:00 2001
2 From: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
3 Date: Mon, 30 Nov 2015 11:05:37 +0900
4 Subject: [PATCH] ivi-shell: multi screen support. ivi_layout_screen to be
5  taken account into property change in commitChanges.
6
7 Property change is now done in update_prop so to consider ivi_screen
8 property for caluculating transform of weston surface, ivi_layout_screen
9  is added as a parameter of update_prop.
10
11 However, update_prop of weston_view of a ivi_surface can not be done
12 even if it is set on a screen. The propoerty change shall be done only
13 when a visibility of ivi_surface or ivi_layer which contains the
14 ivi_surface is ON. Such a condition shall be checked at commit_changes
15 as well to avoid calling update_prop, which actually updates
16 weston_views.
17
18 Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
19 ---
20  ivi-shell/ivi-layout.c | 23 +++++++++++++++++++----
21  1 file changed, 19 insertions(+), 4 deletions(-)
22
23 diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
24 index 31b5def..1773af8 100644
25 --- a/ivi-shell/ivi-layout.c
26 +++ b/ivi-shell/ivi-layout.c
27 @@ -737,16 +737,17 @@ calc_surface_to_global_matrix_and_mask_to_weston_surface(
28  }
29  
30  static void
31 -update_prop(struct ivi_layout_layer *ivilayer,
32 +update_prop(struct ivi_layout_screen  *iviscrn,
33 +           struct ivi_layout_layer *ivilayer,
34             struct ivi_layout_surface *ivisurf)
35  {
36         struct weston_view *tmpview;
37         struct ivi_rectangle r;
38         bool can_calc = true;
39  
40 -       if (!ivilayer->event_mask && !ivisurf->event_mask) {
41 +       /*In case of no prop change, this just returns*/
42 +       if (!ivilayer->event_mask && !ivisurf->event_mask)
43                 return;
44 -       }
45  
46         update_opacity(ivilayer, ivisurf);
47  
48 @@ -802,8 +803,22 @@ commit_changes(struct ivi_layout *layout)
49  
50         wl_list_for_each(iviscrn, &layout->screen_list, link) {
51                 wl_list_for_each(ivilayer, &iviscrn->order.layer_list, order.link) {
52 +                       /*
53 +                        * If ivilayer is invisible, weston_view of ivisurf doesn't
54 +                        * need to be modified.
55 +                        */
56 +                       if (ivilayer->prop.visibility == false)
57 +                               continue;
58 +
59                         wl_list_for_each(ivisurf, &ivilayer->order.surface_list, order.link) {
60 -                               update_prop(ivilayer, ivisurf);
61 +                               /*
62 +                                * If ivilayer is invisible, weston_view of ivisurf doesn't
63 +                                * need to be modified.
64 +                                */
65 +                               if (ivisurf->prop.visibility == false)
66 +                                       continue;
67 +
68 +                               update_prop(iviscrn, ivilayer, ivisurf);
69                         }
70                 }
71         }
72 -- 
73 2.7.4
74