From: Mikko Ylinen Date: Thu, 10 Jan 2013 12:30:37 +0000 (+0200) Subject: Force ELM_WAYLAND_EGL if engine set called when DISPLAY not set X-Git-Tag: accepted/tizen/common/20150312.084940~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a3bec32bcbf1079e9886a9576114bf458c42508;p=platform%2Fupstream%2Felementary.git Force ELM_WAYLAND_EGL if engine set called when DISPLAY not set Some applications are directly calling elm_config_preferred_engine_set. To avoid patching all apps to work with Wayland, always set ELM_WAYLAND_EGL if elm_config_preferred_engine_set is called with EGL_OPENGL_X11 or EGL_SOFTWARE_X11 when DISPLAY is not set. Signed-off-by: Mikko Ylinen --- diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c index c72ebc0..c604c37 100644 --- a/src/lib/elm_config.c +++ b/src/lib/elm_config.c @@ -3365,8 +3365,16 @@ elm_config_preferred_engine_get(void) EAPI void elm_config_preferred_engine_set(const char *engine) { - if (engine) - eina_stringshare_replace(&(_elm_preferred_engine), engine); + char *d; + if (engine) { +#define ENGINE_COMPARE(name) (!strcmp(name, engine)) + if (!(d = getenv("DISPLAY")) && (ENGINE_COMPARE(ELM_SOFTWARE_X11) || + ENGINE_COMPARE(ELM_OPENGL_X11))) + eina_stringshare_replace(&(_elm_preferred_engine), ELM_WAYLAND_EGL); + else + eina_stringshare_replace(&(_elm_preferred_engine), engine); +#undef ENGINE_COMPARE + } else { ELM_SAFE_FREE(_elm_preferred_engine, eina_stringshare_del);