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:
parent
61a567a7e2
commit
62694fbf44
|
@ -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_screen_size_get(int *w, int *h);
|
||||||
EAPI void ecore_wl_pointer_xy_get(int *x, int *y);
|
EAPI void ecore_wl_pointer_xy_get(int *x, int *y);
|
||||||
EAPI int ecore_wl_dpi_get(void);
|
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_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);
|
EAPI void ecore_wl_input_ungrab(Ecore_Wl_Input *input, unsigned int timestamp);
|
||||||
|
|
|
@ -217,7 +217,6 @@ ecore_wl_flush(void)
|
||||||
|
|
||||||
while (_ecore_wl_disp->mask & WL_DISPLAY_WRITABLE)
|
while (_ecore_wl_disp->mask & WL_DISPLAY_WRITABLE)
|
||||||
wl_display_iterate(_ecore_wl_disp->wl.display, 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
|
EAPI void
|
||||||
ecore_wl_sync(void)
|
ecore_wl_sync(void)
|
||||||
{
|
{
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
// LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
wl_display_sync(_ecore_wl_disp->wl.display);
|
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;
|
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 */
|
/* local functions */
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_ecore_wl_shutdown(Eina_Bool close)
|
_ecore_wl_shutdown(Eina_Bool close)
|
||||||
|
|
|
@ -227,25 +227,56 @@ ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, in
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!win) return;
|
if (!win) return;
|
||||||
if ((win->surface) && (buffer))
|
|
||||||
wl_surface_attach(win->surface, buffer, x, y);
|
switch (win->buffer_type)
|
||||||
if (win->surface)
|
|
||||||
{
|
{
|
||||||
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);
|
int dx = 0, dy = 0;
|
||||||
wl_region_destroy(win->region.input);
|
|
||||||
win->region.input = NULL;
|
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)
|
break;
|
||||||
{
|
default:
|
||||||
wl_surface_set_opaque_region(win->surface, win->region.opaque);
|
return;
|
||||||
wl_region_destroy(win->region.opaque);
|
|
||||||
win->region.opaque = NULL;
|
|
||||||
}
|
|
||||||
wl_surface_damage(win->surface, 0, 0,
|
|
||||||
win->allocation.w, win->allocation.h);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue