]> git.pld-linux.org Git - packages/ecore.git/blame - ecore-wayland.patch
- updated to 1.7.2
[packages/ecore.git] / ecore-wayland.patch
CommitLineData
2df4acd6
JB
1#Index: /trunk/ecore/src/lib/ecore_evas/ecore_evas_wayland_common.c
2#===================================================================
3#--- /trunk/ecore/src/lib/ecore_evas/ecore_evas_wayland_common.c (revision 78047)
4#+++ /trunk/ecore/src/lib/ecore_evas/ecore_evas_wayland_common.c (revision 78048)
5#@@ -351,5 +351,4 @@
6#
7# sd->frame = evas_object_rectangle_add(evas);
8#- evas_object_is_frame_object_set(sd->frame, EINA_TRUE);
9# evas_object_color_set(sd->frame, 249, 249, 249, 255);
10# evas_object_smart_member_add(sd->frame, obj);
11#@@ -360,4 +359,5 @@
12# evas_object_text_font_set(sd->text, "Sans", 10);
13# evas_object_text_text_set(sd->text, "Smart Test");
14#+ evas_object_smart_member_add(sd->text, obj);
15#
16# evas_object_smart_data_set(obj, sd);
17Index: /trunk/ecore/src/lib/ecore_wayland/Ecore_Wayland.h
18===================================================================
19--- /trunk/ecore/src/lib/ecore_wayland/Ecore_Wayland.h (revision 78048)
20+++ /trunk/ecore/src/lib/ecore_wayland/Ecore_Wayland.h (revision 78049)
21@@ -76,4 +76,5 @@
22 {
23 struct wl_display *display;
24+ struct wl_registry *registry;
25 struct wl_compositor *compositor;
26 struct wl_shell *shell;
27Index: /trunk/ecore/src/lib/ecore_wayland/ecore_wl.c
28===================================================================
29--- /trunk/ecore/src/lib/ecore_wayland/ecore_wl.c (revision 78049)
30+++ /trunk/ecore/src/lib/ecore_wayland/ecore_wl.c (revision 78050)
31@@ -8,7 +8,6 @@
32 /* local function prototypes */
33 static Eina_Bool _ecore_wl_shutdown(Eina_Bool close);
34-static int _ecore_wl_cb_event_mask_update(unsigned int mask, void *data);
35-static Eina_Bool _ecore_wl_cb_handle_data(void *data, Ecore_Fd_Handler *hdl __UNUSED__);
36-static void _ecore_wl_cb_handle_global(struct wl_display *disp, unsigned int id, const char *interface, unsigned int version __UNUSED__, void *data);
37+static Eina_Bool _ecore_wl_cb_handle_data(void *data, Ecore_Fd_Handler *hdl);
38+static void _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned int id, const char *interface, unsigned int version __UNUSED__);
39 static Eina_Bool _ecore_wl_xkb_init(Ecore_Wl_Display *ewd);
40 static Eina_Bool _ecore_wl_xkb_shutdown(Ecore_Wl_Display *ewd);
41@@ -16,4 +15,9 @@
42 /* local variables */
43 static int _ecore_wl_init_count = 0;
44+static const struct wl_registry_listener _ecore_wl_registry_listener =
45+{
46+ _ecore_wl_cb_handle_global,
47+ NULL // handle_global_remove
48+};
49
50 /* external variables */
51@@ -131,10 +135,9 @@
52 }
53
54- _ecore_wl_disp->fd =
55- wl_display_get_fd(_ecore_wl_disp->wl.display,
56- _ecore_wl_cb_event_mask_update, _ecore_wl_disp);
57+ _ecore_wl_disp->fd = wl_display_get_fd(_ecore_wl_disp->wl.display);
58
59 _ecore_wl_disp->fd_hdl =
60- ecore_main_fd_handler_add(_ecore_wl_disp->fd, ECORE_FD_READ,
61+ ecore_main_fd_handler_add(_ecore_wl_disp->fd,
62+ ECORE_FD_READ | ECORE_FD_WRITE,
63 _ecore_wl_cb_handle_data, _ecore_wl_disp,
64 NULL, NULL);
65@@ -143,11 +146,10 @@
66 wl_list_init(&_ecore_wl_disp->outputs);
67
68- wl_display_add_global_listener(_ecore_wl_disp->wl.display,
69- _ecore_wl_cb_handle_global, _ecore_wl_disp);
70-
71- /* Init egl */
72-
73- /* FIXME: Process connection events ?? */
74- /* wl_display_iterate(_ecore_wl_disp->wl.display, WL_DISPLAY_READABLE); */
75+ _ecore_wl_disp->wl.registry =
76+ wl_display_get_registry(_ecore_wl_disp->wl.display);
77+ wl_registry_add_listener(_ecore_wl_disp->wl.registry,
78+ &_ecore_wl_registry_listener, _ecore_wl_disp);
79+
80+ wl_display_dispatch(_ecore_wl_disp->wl.display);
81
82 /* TODO: create pointer surfaces */
83@@ -207,6 +209,5 @@
84 // LOGFN(__FILE__, __LINE__, __FUNCTION__);
85
86- while (_ecore_wl_disp->mask & WL_DISPLAY_WRITABLE)
87- wl_display_iterate(_ecore_wl_disp->wl.display, WL_DISPLAY_WRITABLE);
88+ wl_display_flush(_ecore_wl_disp->wl.display);
89 }
90
91@@ -324,5 +325,5 @@
92 ecore_wl_display_iterate(void)
93 {
94- wl_display_iterate(_ecore_wl_disp->wl.display, WL_DISPLAY_READABLE);
95+ wl_display_dispatch(_ecore_wl_disp->wl.display);
96 }
97
98@@ -397,41 +398,37 @@
99 }
100
101-static int
102-_ecore_wl_cb_event_mask_update(unsigned int mask, void *data)
103+static Eina_Bool
104+_ecore_wl_cb_handle_data(void *data, Ecore_Fd_Handler *hdl)
105 {
106 Ecore_Wl_Display *ewd;
107
108+ /* LOGFN(__FILE__, __LINE__, __FUNCTION__); */
109+
110+ if (!(ewd = data)) return ECORE_CALLBACK_RENEW;
111+
112+ /* FIXME: This should also catch ECORE_FD_ERROR and exit */
113+
114+ if (ecore_main_fd_handler_active_get(hdl, ECORE_FD_READ))
115+ wl_display_dispatch(ewd->wl.display);
116+ else if (ecore_main_fd_handler_active_get(hdl, ECORE_FD_WRITE))
117+ wl_display_flush(ewd->wl.display);
118+
119+ return ECORE_CALLBACK_RENEW;
120+}
121+
122+static void
123+_ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned int id, const char *interface, unsigned int version __UNUSED__)
124+{
125+ Ecore_Wl_Display *ewd;
126+
127 // LOGFN(__FILE__, __LINE__, __FUNCTION__);
128
129 ewd = data;
130- ewd->mask = mask;
131- return 0;
132-}
133-
134-static Eina_Bool
135-_ecore_wl_cb_handle_data(void *data, Ecore_Fd_Handler *hdl __UNUSED__)
136-{
137- Ecore_Wl_Display *ewd;
138-
139- /* LOGFN(__FILE__, __LINE__, __FUNCTION__); */
140-
141- if (!(ewd = data)) return ECORE_CALLBACK_RENEW;
142- wl_display_iterate(ewd->wl.display, ewd->mask);
143- return ECORE_CALLBACK_RENEW;
144-}
145-
146-static void
147-_ecore_wl_cb_handle_global(struct wl_display *disp, unsigned int id, const char *interface, unsigned int version __UNUSED__, void *data)
148-{
149- Ecore_Wl_Display *ewd;
150-
151-// LOGFN(__FILE__, __LINE__, __FUNCTION__);
152-
153- ewd = data;
154-
155- /* TODO: Add listener for wl_display so we can catch fatal errors !! */
156
157 if (!strcmp(interface, "wl_compositor"))
158- ewd->wl.compositor = wl_display_bind(disp, id, &wl_compositor_interface);
159+ {
160+ ewd->wl.compositor =
161+ wl_registry_bind(registry, id, &wl_compositor_interface, 1);
162+ }
163 else if (!strcmp(interface, "wl_output"))
164 _ecore_wl_output_add(ewd, id);
165@@ -439,10 +436,11 @@
166 _ecore_wl_input_add(ewd, id);
167 else if (!strcmp(interface, "wl_shell"))
168- ewd->wl.shell = wl_display_bind(disp, id, &wl_shell_interface);
169- /* else if (!strcmp(interface, "desktop_shell")) */
170- /* ewd->wl.desktop_shell = wl_display_bind(disp, id, &wl_shell_interface); */
171+ {
172+ ewd->wl.shell =
173+ wl_registry_bind(registry, id, &wl_shell_interface, 1);
174+ }
175 else if (!strcmp(interface, "wl_shm"))
176 {
177- ewd->wl.shm = wl_display_bind(disp, id, &wl_shm_interface);
178+ ewd->wl.shm = wl_registry_bind(registry, id, &wl_shm_interface, 1);
179
180 /* FIXME: We should not hard-code a cursor size here, and we should
181@@ -453,5 +451,5 @@
182 {
183 ewd->wl.data_device_manager =
184- wl_display_bind(disp, id, &wl_data_device_manager_interface);
185+ wl_registry_bind(registry, id, &wl_data_device_manager_interface, 1);
186 }
187
188Index: /trunk/ecore/src/lib/ecore_wayland/ecore_wl_window.c
189===================================================================
190--- /trunk/ecore/src/lib/ecore_wayland/ecore_wl_window.c (revision 78050)
191+++ /trunk/ecore/src/lib/ecore_wayland/ecore_wl_window.c (revision 78051)
192@@ -252,5 +252,8 @@
193 if (!win) return;
194 if (win->surface)
195- wl_surface_damage(win->surface, x, y, w, h);
196+ {
197+ wl_surface_damage(win->surface, x, y, w, h);
198+ wl_surface_commit(win->surface);
199+ }
200 }
201
202@@ -287,4 +290,5 @@
203 wl_surface_damage(win->surface, 0, 0,
204 win->allocation.w, win->allocation.h);
205+ wl_surface_commit(win->surface);
206
207 win->server_allocation = win->allocation;
208Index: /trunk/ecore/src/lib/ecore_wayland/ecore_wl_output.c
209===================================================================
210--- /trunk/ecore/src/lib/ecore_wayland/ecore_wl_output.c (revision 78051)
211+++ /trunk/ecore/src/lib/ecore_wayland/ecore_wl_output.c (revision 78052)
212@@ -36,5 +36,7 @@
213 output->display = ewd;
214
215- output->output = wl_display_bind(ewd->wl.display, id, &wl_output_interface);
216+ output->output =
217+ wl_registry_bind(ewd->wl.registry, id, &wl_output_interface, 1);
218+
219 wl_list_insert(ewd->outputs.prev, &output->link);
220 wl_output_add_listener(output->output, &_ecore_wl_output_listener, output);
221#Index: /trunk/ecore/src/lib/ecore_evas/ecore_evas_wayland_common.c
222#===================================================================
223#--- /trunk/ecore/src/lib/ecore_evas/ecore_evas_wayland_common.c (revision 78052)
224#+++ /trunk/ecore/src/lib/ecore_evas/ecore_evas_wayland_common.c (revision 78053)
225#@@ -452,6 +452,6 @@
226# EE_Wl_Smart_Data *sd;
227#
228#- if (!(sd = evas_object_smart_data_get(ee->engine.wl.frame))) return;
229#- evas_object_text_text_set(sd->text, ee->prop.title);
230#+ if ((sd = evas_object_smart_data_get(ee->engine.wl.frame)))
231#+ evas_object_text_text_set(sd->text, ee->prop.title);
232# }
233#
234Index: /trunk/ecore/src/lib/ecore_wayland/ecore_wl_input.c
235===================================================================
236--- /trunk/ecore/src/lib/ecore_wayland/ecore_wl_input.c (revision 78053)
237+++ /trunk/ecore/src/lib/ecore_wayland/ecore_wl_input.c (revision 78054)
238@@ -177,11 +177,16 @@
239 if (!(cursor = ecore_wl_cursor_get(input->cursor_name)))
240 {
241+ printf("No Cursor %s in Theme\n", input->cursor_name);
242 /* if the theme does not have this cursor, default to left pointer */
243 if (!(cursor = ecore_wl_cursor_get("left_ptr")))
244- return;
245+ {
246+ printf("Failed to get Left Pointer Cursor\n");
247+ return;
248+ }
249 }
250
251 if ((!cursor->images) || (!cursor->images[0]))
252 {
253+ printf("Cursor %s has no images\n", input->cursor_name);
254 ecore_wl_input_pointer_set(input, NULL, 0, 0);
255 return;
256@@ -197,8 +202,11 @@
257 wl_surface_damage(input->cursor_surface, 0, 0,
258 cursor_image->width, cursor_image->height);
259+ wl_surface_commit(input->cursor_surface);
260
261 if (!input->cursor_frame_cb)
262 _ecore_wl_input_cb_pointer_frame(input, NULL, 0);
263 }
264+ else
265+ printf("No Buffer from Cursor Image\n");
266 }
267
268@@ -231,6 +239,7 @@
269
270 input->seat =
271- wl_display_bind(ewd->wl.display, id, &wl_seat_interface);
272+ wl_registry_bind(ewd->wl.registry, id, &wl_seat_interface, 1);
273 wl_list_insert(ewd->inputs.prev, &input->link);
274+
275 wl_seat_add_listener(input->seat,
276 &_ecore_wl_seat_listener, input);
277@@ -322,7 +331,10 @@
278 Ecore_Wl_Input *input;
279
280- if (!(input = data)) return;
281+ printf("Seat Handle Capabilities\n");
282+ if (!(input = data)) return;
283+ printf("\tInput Valid\n");
284 if ((caps & WL_SEAT_CAPABILITY_POINTER) && (!input->pointer))
285 {
286+ printf("\tCreate New Pointer\n");
287 input->pointer = wl_seat_get_pointer(seat);
288 wl_pointer_set_user_data(input->pointer, input);
289@@ -331,4 +343,5 @@
290 else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && (input->pointer))
291 {
292+ printf("\tDestroy POinter\n");
293 wl_pointer_destroy(input->pointer);
294 input->pointer = NULL;
295@@ -367,4 +380,6 @@
296
297 /* LOGFN(__FILE__, __LINE__, __FUNCTION__); */
298+
299+ printf("Input Cb Pointer Motion\n");
300
301 if (!(input = data)) return;
302@@ -675,4 +690,6 @@
303 LOGFN(__FILE__, __LINE__, __FUNCTION__);
304
305+ printf("Input Cb Pointer Enter\n");
306+
307 if (!surface) return;
308 if (!(input = data)) return;
309@@ -691,14 +708,14 @@
310 input->pointer_enter_serial = serial;
311
312- if (!(win = wl_surface_get_user_data(surface))) return;
313-
314- win->pointer_device = input;
315- input->pointer_focus = win;
316-
317- /* _ecore_wl_input_mouse_move_send(input, win, input->timestamp); */
318- _ecore_wl_input_mouse_in_send(input, win, input->timestamp);
319-
320 /* The cursor on the surface is undefined until we set it */
321 ecore_wl_input_cursor_from_name_set(input, "left_ptr");
322+
323+ if ((win = wl_surface_get_user_data(surface)))
324+ {
325+ win->pointer_device = input;
326+ input->pointer_focus = win;
327+
328+ _ecore_wl_input_mouse_in_send(input, win, input->timestamp);
329+ }
330
331 /* NB: This whole 'if' below is a major HACK due to wayland's stupidness
332@@ -742,4 +759,6 @@
333 Ecore_Wl_Window *win;
334
335+ printf("Input Cb Pointer Leave\n");
336+
337 LOGFN(__FILE__, __LINE__, __FUNCTION__);
338
339@@ -771,4 +790,6 @@
340 Ecore_Wl_Input *input;
341 Ecore_Wl_Window *win = NULL;
342+
343+ printf("Keyboard Enter Event\n");
344
345 LOGFN(__FILE__, __LINE__, __FUNCTION__);
346Index: /trunk/ecore/src/lib/ecore_wayland/ecore_wl.c
347===================================================================
348--- /trunk/ecore/src/lib/ecore_wayland/ecore_wl.c (revision 78054)
349+++ /trunk/ecore/src/lib/ecore_wayland/ecore_wl.c (revision 78055)
350@@ -139,5 +139,5 @@
351 _ecore_wl_disp->fd_hdl =
352 ecore_main_fd_handler_add(_ecore_wl_disp->fd,
353- ECORE_FD_READ | ECORE_FD_WRITE,
354+ ECORE_FD_READ | ECORE_FD_WRITE,
355 _ecore_wl_cb_handle_data, _ecore_wl_disp,
356 NULL, NULL);
357@@ -152,6 +152,4 @@
358
359 wl_display_dispatch(_ecore_wl_disp->wl.display);
360-
361- /* TODO: create pointer surfaces */
362
363 if (!_ecore_wl_xkb_init(_ecore_wl_disp))
364@@ -409,4 +407,6 @@
365 /* FIXME: This should also catch ECORE_FD_ERROR and exit */
366
367+ /* wl_display_dispatch_pending(ewd->wl.display); */
368+
369 if (ecore_main_fd_handler_active_get(hdl, ECORE_FD_READ))
370 wl_display_dispatch(ewd->wl.display);
371@@ -422,5 +422,5 @@
372 Ecore_Wl_Display *ewd;
373
374-// LOGFN(__FILE__, __LINE__, __FUNCTION__);
375+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
376
377 ewd = data;
378Index: /trunk/ecore/src/lib/ecore_wayland/ecore_wl_input.c
379===================================================================
380--- /trunk/ecore/src/lib/ecore_wayland/ecore_wl_input.c (revision 78055)
381+++ /trunk/ecore/src/lib/ecore_wayland/ecore_wl_input.c (revision 78056)
382@@ -177,16 +177,11 @@
383 if (!(cursor = ecore_wl_cursor_get(input->cursor_name)))
384 {
385- printf("No Cursor %s in Theme\n", input->cursor_name);
386 /* if the theme does not have this cursor, default to left pointer */
387 if (!(cursor = ecore_wl_cursor_get("left_ptr")))
388- {
389- printf("Failed to get Left Pointer Cursor\n");
390- return;
391- }
392+ return;
393 }
394
395 if ((!cursor->images) || (!cursor->images[0]))
396 {
397- printf("Cursor %s has no images\n", input->cursor_name);
398 ecore_wl_input_pointer_set(input, NULL, 0, 0);
399 return;
400@@ -207,6 +202,4 @@
401 _ecore_wl_input_cb_pointer_frame(input, NULL, 0);
402 }
403- else
404- printf("No Buffer from Cursor Image\n");
405 }
406
407@@ -331,10 +324,8 @@
408 Ecore_Wl_Input *input;
409
410- printf("Seat Handle Capabilities\n");
411- if (!(input = data)) return;
412- printf("\tInput Valid\n");
413+ if (!(input = data)) return;
414+
415 if ((caps & WL_SEAT_CAPABILITY_POINTER) && (!input->pointer))
416 {
417- printf("\tCreate New Pointer\n");
418 input->pointer = wl_seat_get_pointer(seat);
419 wl_pointer_set_user_data(input->pointer, input);
420@@ -343,5 +334,4 @@
421 else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && (input->pointer))
422 {
423- printf("\tDestroy POinter\n");
424 wl_pointer_destroy(input->pointer);
425 input->pointer = NULL;
426@@ -380,6 +370,4 @@
427
428 /* LOGFN(__FILE__, __LINE__, __FUNCTION__); */
429-
430- printf("Input Cb Pointer Motion\n");
431
432 if (!(input = data)) return;
433@@ -690,6 +678,4 @@
434 LOGFN(__FILE__, __LINE__, __FUNCTION__);
435
436- printf("Input Cb Pointer Enter\n");
437-
438 if (!surface) return;
439 if (!(input = data)) return;
440@@ -759,6 +745,4 @@
441 Ecore_Wl_Window *win;
442
443- printf("Input Cb Pointer Leave\n");
444-
445 LOGFN(__FILE__, __LINE__, __FUNCTION__);
446
447@@ -790,6 +774,4 @@
448 Ecore_Wl_Input *input;
449 Ecore_Wl_Window *win = NULL;
450-
451- printf("Keyboard Enter Event\n");
452
453 LOGFN(__FILE__, __LINE__, __FUNCTION__);
454Index: /trunk/ecore/ChangeLog
455===================================================================
456--- /trunk/ecore/ChangeLog (revision 78056)
457+++ /trunk/ecore/ChangeLog (revision 78057)
458@@ -1012,2 +1012,5 @@
459 * Since evas has 8bit engines removed, remove support from ecore-evas.
460
461+2012-10-16 Christopher Michael
462+
463+ * Update Ecore_Wayland to build & work with newest wayland (0.99) from git
464Index: /trunk/ecore/NEWS
465===================================================================
466--- /trunk/ecore/NEWS (revision 78057)
467+++ /trunk/ecore/NEWS (revision 78058)
468@@ -39,4 +39,6 @@
469 - ecore_x_randr to actually return crtcs outputs properly.
470 - send ECORE_X_EVENT_SELECTION_NOTIFY even if there is no data.
471+ * ecore_wayland:
472+ - Update to work with latest wayland (0.99) from git.
473
474 Removal:
This page took 0.108528 seconds and 4 git commands to generate.