d2d0272569fc9f6a9d95c49376c1517927b131b5
[AGL/meta-agl-demo.git] / recipes-graphics / wayland / wayland-ivi-extension / 0003-ivi-controller-add-resize-setting-suit-to-surface-si.patch
1 From 525b5bf65303d661f44c01b11bafd5ba90976850 Mon Sep 17 00:00:00 2001
2 From: Wataru Mizuno <wmizuno@jp.adit-jv.com>
3 Date: Wed, 6 Dec 2017 19:35:51 +0900
4 Subject: [PATCH] ivi-controller: add resize setting suit to surface size
5
6 The ivi-controller resizes surface size like desktop usecase.
7
8 When window manager swicths the half size window to full size,
9 resize was not working correctly.
10 This patch fixs this issue by changing surface source region at
11 the same timing of destination region is changed.
12
13 This patch is not necessary later version of wayland-ivi-extension
14 2.0 since this resize function has already been implemented by
15 appropriate manner.
16
17 Signed-off-by: Wataru Mizuno <wmizuno@jp.adit-jv.com>
18 ---
19  weston-ivi-shell/src/ivi-controller.c | 17 ++++++++++++++---
20  1 file changed, 14 insertions(+), 3 deletions(-)
21
22 diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c
23 index 312a978..9450cf2 100644
24 --- a/weston-ivi-shell/src/ivi-controller.c
25 +++ b/weston-ivi-shell/src/ivi-controller.c
26 @@ -1334,7 +1334,7 @@ surface_event_configure(struct wl_listener *listener, void *data)
27      struct ivisurface *ivisurf = NULL;
28      struct ivi_layout_surface *layout_surface =
29             (struct ivi_layout_surface *) data;
30 -    const struct ivi_layout_surface_properties *prop;
31 +    struct weston_surface *w_surface;
32  
33      ivisurf = get_surface(&shell->list_surface, layout_surface);
34      if (ivisurf == NULL) {
35 @@ -1342,11 +1342,22 @@ surface_event_configure(struct wl_listener *listener, void *data)
36          return;
37      }
38  
39 -    prop = lyt->get_properties_of_surface(layout_surface);
40 +    w_surface = lyt->surface_get_weston_surface(layout_surface);
41 +    lyt->surface_set_destination_rectangle(layout_surface,
42 +                                          ivisurf->prop->dest_x,
43 +                                          ivisurf->prop->dest_y,
44 +                                          w_surface->width,
45 +                                          w_surface->height);
46 +    lyt->surface_set_source_rectangle(layout_surface,
47 +                                     0,
48 +                                     0,
49 +                                     w_surface->width,
50 +                                     w_surface->height);
51 +    lyt->commit_changes();
52  
53      wl_resource_for_each(resource, &ivisurf->resource_list) {
54          send_surface_event(resource, ivisurf,
55 -                           prop, IVI_NOTIFICATION_CONFIGURE);
56 +                           ivisurf->prop, IVI_NOTIFICATION_CONFIGURE);
57      }
58  }
59  
60 -- 
61 2.7.4
62