From c75ef372588719221e4e309ae5bc9f7dfe20f65c Mon Sep 17 00:00:00 2001 From: devilhorns Date: Fri, 13 Jan 2012 06:30:27 +0000 Subject: [PATCH] Ecore_Wayland: Handle shm format iteration a bit better. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@67177 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore_wayland/ecore_wl.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c index 71cccd5..60d5e33 100644 --- a/src/lib/ecore_wayland/ecore_wl.c +++ b/src/lib/ecore_wayland/ecore_wl.c @@ -66,7 +66,7 @@ static void _ecore_wl_focus_in_send(struct wl_surface *surface, uint32_t timesta static int _ecore_wl_init_count = 0; static struct wl_display *_ecore_wl_disp = NULL; static uint32_t _ecore_wl_disp_mask = 0; -static uint32_t _ecore_wl_disp_format = WL_SHM_FORMAT_ARGB8888; +static uint32_t _ecore_wl_disp_format = -1; static Eina_Rectangle _ecore_wl_screen; static Ecore_Fd_Handler *_ecore_wl_fd_hdl = NULL; static int _ecore_wl_screen_x = 0; @@ -414,9 +414,15 @@ _ecore_wl_cb_shm_format_iterate(void *data __UNUSED__, struct wl_shm *shm __UNUS { // LOGFN(__FILE__, __LINE__, __FUNCTION__); -// if (_ecore_wl_disp_format < 1) return; + /* if we have already iterated here and found the format, then no need to + * check anymore */ + if (_ecore_wl_disp_format >= 0) return; + switch (format) { + case WL_SHM_FORMAT_ARGB8888: + _ecore_wl_disp_format = format; + break; case WL_SHM_FORMAT_XRGB8888: _ecore_wl_disp_format = format; break; -- 2.7.4