Ecore_Wayland: Add an API function which calls wl_display_iterate(readable).

Fix ecore_wl_window surface attach of the buffer for shm and egl types.

NB: This ensures that both efl/elm clients work under the Wayland
Compositor AND the E17 Compositor.

NB: The issue here is that clients (when run under the Wayland
compositor) need to make sure 'iterate' has
been called before creating surfaces so that the wl_compositor is
setup. However, the actual E17 Compositor will hang if 'iterate' is called
to early.



SVN revision: 69707
This commit is contained in:
Christopher Michael 2012-03-29 01:26:30 +00:00
parent 61a567a7e2
commit 62694fbf44
3 changed files with 54 additions and 22 deletions

View File

@ -276,6 +276,7 @@ EAPI struct wl_display *ecore_wl_display_get(void);
EAPI void ecore_wl_screen_size_get(int *w, int *h);
EAPI void ecore_wl_pointer_xy_get(int *x, int *y);
EAPI int ecore_wl_dpi_get(void);
EAPI void ecore_wl_display_iterate(void);
EAPI void ecore_wl_input_grab(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int button);
EAPI void ecore_wl_input_ungrab(Ecore_Wl_Input *input, unsigned int timestamp);

View File

@ -217,7 +217,6 @@ ecore_wl_flush(void)
while (_ecore_wl_disp->mask & WL_DISPLAY_WRITABLE)
wl_display_iterate(_ecore_wl_disp->wl.display, WL_DISPLAY_WRITABLE);
// wl_display_flush(_ecore_wl_disp->wl.display); // old flush code
}
/**
@ -230,14 +229,9 @@ ecore_wl_flush(void)
EAPI void
ecore_wl_sync(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
// LOGFN(__FILE__, __LINE__, __FUNCTION__);
wl_display_sync(_ecore_wl_disp->wl.display);
//wl_display_roundtrip(_ecore_wl_disp->wl.display);
// old sync code
// wl_display_iterate(_ecore_wl_disp->wl.display, WL_DISPLAY_READABLE);
}
/**
@ -326,6 +320,12 @@ ecore_wl_dpi_get(void)
return (((w * 254) / mw) + 5) / 10;
}
EAPI void
ecore_wl_display_iterate(void)
{
wl_display_iterate(_ecore_wl_disp->wl.display, WL_DISPLAY_READABLE);
}
/* local functions */
static Eina_Bool
_ecore_wl_shutdown(Eina_Bool close)

View File

@ -227,25 +227,56 @@ ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, in
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
if ((win->surface) && (buffer))
wl_surface_attach(win->surface, buffer, x, y);
if (win->surface)
switch (win->buffer_type)
{
if (win->region.input)
case ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW:
/* FIXME: weston has wl_egl_window_get_attached_size */
break;
case ECORE_WL_WINDOW_BUFFER_TYPE_EGL_IMAGE:
case ECORE_WL_WINDOW_BUFFER_TYPE_SHM:
if (win->surface)
{
wl_surface_set_input_region(win->surface, win->region.input);
wl_region_destroy(win->region.input);
win->region.input = NULL;
int dx = 0, dy = 0;
if ((win->server_allocation.w != win->allocation.w) ||
(win->server_allocation.h != win->allocation.h))
{
dx = win->allocation.w - win->server_allocation.w;
dy = win->allocation.h - win->server_allocation.h;
if (buffer)
wl_surface_attach(win->surface, buffer, dx, dy);
}
else
{
if (buffer)
wl_surface_attach(win->surface, buffer, x, y);
}
win->server_allocation = win->allocation;
}
if (win->region.opaque)
{
wl_surface_set_opaque_region(win->surface, win->region.opaque);
wl_region_destroy(win->region.opaque);
win->region.opaque = NULL;
}
wl_surface_damage(win->surface, 0, 0,
win->allocation.w, win->allocation.h);
break;
default:
return;
}
if (win->region.input)
{
wl_surface_set_input_region(win->surface, win->region.input);
wl_region_destroy(win->region.input);
win->region.input = NULL;
}
if (win->region.opaque)
{
wl_surface_set_opaque_region(win->surface, win->region.opaque);
wl_region_destroy(win->region.opaque);
win->region.opaque = NULL;
}
if (win->surface)
wl_surface_damage(win->surface, 0, 0,
win->allocation.w, win->allocation.h);
}
/**