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);
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
}
/**
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);
}
/**
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)
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)
- {
- wl_surface_set_input_region(win->surface, win->region.input);
- wl_region_destroy(win->region.input);
- win->region.input = NULL;
- }
- if (win->region.opaque)
+ 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_opaque_region(win->surface, win->region.opaque);
- wl_region_destroy(win->region.opaque);
- win->region.opaque = 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;
}
- 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);
}
/**