Upgrade to thud
[AGL/meta-agl.git] / meta-agl-profile-graphical / recipes-graphics / wayland / weston / 0013-simple-egl-remove-ivi-application-support.patch
1 diff --git a/Makefile.am b/Makefile.am
2 index 17c053e6..e0d3cb78 100644
3 --- a/Makefile.am
4 +++ b/Makefile.am
5 @@ -609,9 +609,7 @@ demo_clients += weston-simple-egl
6  weston_simple_egl_SOURCES = clients/simple-egl.c
7  nodist_weston_simple_egl_SOURCES =             \
8         protocol/xdg-shell-unstable-v6-protocol.c               \
9 -       protocol/xdg-shell-unstable-v6-client-protocol.h        \
10 -       protocol/ivi-application-protocol.c             \
11 -       protocol/ivi-application-client-protocol.h
12 +       protocol/xdg-shell-unstable-v6-client-protocol.h
13  weston_simple_egl_CFLAGS = $(AM_CFLAGS) $(SIMPLE_EGL_CLIENT_CFLAGS)
14  weston_simple_egl_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm
15  endif
16 diff --git a/clients/simple-egl.c b/clients/simple-egl.c
17 index a1e57aef..936e015e 100644
18 --- a/clients/simple-egl.c
19 +++ b/clients/simple-egl.c
20 @@ -45,8 +45,6 @@
21  #include "xdg-shell-unstable-v6-client-protocol.h"
22  #include <sys/types.h>
23  #include <unistd.h>
24 -#include "ivi-application-client-protocol.h"
25 -#define IVI_SURFACE_ID 9000
26  
27  #include "shared/helpers.h"
28  #include "shared/platform.h"
29 @@ -74,7 +72,6 @@ struct display {
30                 EGLConfig conf;
31         } egl;
32         struct window *window;
33 -       struct ivi_application *ivi_application;
34  
35         PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC swap_buffers_with_damage;
36  };
37 @@ -97,7 +94,6 @@ struct window {
38         struct wl_surface *surface;
39         struct zxdg_surface_v6 *xdg_surface;
40         struct zxdg_toplevel_v6 *xdg_toplevel;
41 -       struct ivi_surface *ivi_surface;
42         EGLSurface egl_surface;
43         struct wl_callback *callback;
44         int fullscreen, maximized, opaque, buffer_size, frame_sync, delay;
45 @@ -359,27 +355,22 @@ static const struct zxdg_toplevel_v6_listener xdg_toplevel_listener = {
46  };
47  
48  static void
49 -handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface,
50 -                             int32_t width, int32_t height)
51 +create_surface(struct window *window)
52  {
53 -       struct window *window = data;
54 -
55 -       wl_egl_window_resize(window->native, width, height, 0, 0);
56 -
57 -       window->geometry.width = width;
58 -       window->geometry.height = height;
59 +       struct display *display = window->display;
60 +       EGLBoolean ret;
61  
62 -       if (!window->fullscreen)
63 -               window->window_size = window->geometry;
64 -}
65 +       window->surface = wl_compositor_create_surface(display->compositor);
66  
67 -static const struct ivi_surface_listener ivi_surface_listener = {
68 -       handle_ivi_surface_configure,
69 -};
70 +       window->native =
71 +               wl_egl_window_create(window->surface,
72 +                                    window->geometry.width,
73 +                                    window->geometry.height);
74 +       window->egl_surface =
75 +               weston_platform_create_egl_surface(display->egl.dpy,
76 +                                                  display->egl.conf,
77 +                                                  window->native, NULL);
78  
79 -static void
80 -create_xdg_surface(struct window *window, struct display *display)
81 -{
82         window->xdg_surface = zxdg_shell_v6_get_xdg_surface(display->shell,
83                                                             window->surface);
84         zxdg_surface_v6_add_listener(window->xdg_surface,
85 @@ -394,50 +385,6 @@ create_xdg_surface(struct window *window, struct display *display)
86  
87         window->wait_for_configure = true;
88         wl_surface_commit(window->surface);
89 -}
90 -
91 -static void
92 -create_ivi_surface(struct window *window, struct display *display)
93 -{
94 -       uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid();
95 -       window->ivi_surface =
96 -               ivi_application_surface_create(display->ivi_application,
97 -                                              id_ivisurf, window->surface);
98 -
99 -       if (window->ivi_surface == NULL) {
100 -               fprintf(stderr, "Failed to create ivi_client_surface\n");
101 -               abort();
102 -       }
103 -
104 -       ivi_surface_add_listener(window->ivi_surface,
105 -                                &ivi_surface_listener, window);
106 -}
107 -
108 -static void
109 -create_surface(struct window *window)
110 -{
111 -       struct display *display = window->display;
112 -       EGLBoolean ret;
113 -
114 -       window->surface = wl_compositor_create_surface(display->compositor);
115 -
116 -       window->native =
117 -               wl_egl_window_create(window->surface,
118 -                                    window->geometry.width,
119 -                                    window->geometry.height);
120 -       window->egl_surface =
121 -               weston_platform_create_egl_surface(display->egl.dpy,
122 -                                                  display->egl.conf,
123 -                                                  window->native, NULL);
124 -
125 -
126 -       if (display->shell) {
127 -               create_xdg_surface(window, display);
128 -       } else if (display->ivi_application ) {
129 -               create_ivi_surface(window, display);
130 -       } else {
131 -               assert(0);
132 -       }
133  
134         ret = eglMakeCurrent(window->display->egl.dpy, window->egl_surface,
135                              window->egl_surface, window->display->egl.ctx);
136 @@ -469,8 +416,6 @@ destroy_surface(struct window *window)
137                 zxdg_toplevel_v6_destroy(window->xdg_toplevel);
138         if (window->xdg_surface)
139                 zxdg_surface_v6_destroy(window->xdg_surface);
140 -       if (window->display->ivi_application)
141 -               ivi_surface_destroy(window->ivi_surface);
142         wl_surface_destroy(window->surface);
143  
144         if (window->callback)
145 @@ -825,10 +770,6 @@ registry_handle_global(void *data, struct wl_registry *registry,
146                         fprintf(stderr, "unable to load default left pointer\n");
147                         // TODO: abort ?
148                 }
149 -       } else if (strcmp(interface, "ivi_application") == 0) {
150 -               d->ivi_application =
151 -                       wl_registry_bind(registry, name,
152 -                                        &ivi_application_interface, 1);
153         }
154  }
155  
156 @@ -943,9 +884,6 @@ main(int argc, char **argv)
157         if (display.shell)
158                 zxdg_shell_v6_destroy(display.shell);
159  
160 -       if (display.ivi_application)
161 -               ivi_application_destroy(display.ivi_application);
162 -
163         if (display.compositor)
164                 wl_compositor_destroy(display.compositor);
165