devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=a911794e1a48336a4c6b1d596e3a391dd04090e0

commit a911794e1a48336a4c6b1d596e3a391dd04090e0
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Thu Jul 17 12:50:51 2014 -0400

    elementary: Don't segfault if we are not using an X11-compatible engine
    
    When running Enlightenment under Wayland only, during init of E we
    make a call to elm_config_all_flush. elm_config_all_flush is making
    calls to ecore_x_window function(s) (for setting of elm_profile),
    However this causes a crash if the ELM_ENGINE is not one that is
    running under X11 (ie: ELM_ENGINE=drm or wayland_*). So to fix this
    crash, we will compare the current ELM_ENGINE and see if it is
    X11-compatible before making unnecessary (and crashing) calls to
    ecore_x_window functions.
    
    @fix
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/elm_config.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index f3bce0d..b308928 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -3137,11 +3137,21 @@ elm_config_audio_mute_set(Edje_Channel channel, 
Eina_Bool mute)
 EAPI void
 elm_config_all_flush(void)
 {
+#define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
+   if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
+       ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
+       ENGINE_COMPARE(ELM_XRENDER_X11) ||
+       ENGINE_COMPARE(ELM_OPENGL_X11) ||
+       ENGINE_COMPARE(ELM_OPENGL_COCOA) ||
+       ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
+#undef ENGINE_COMPARE
+     {
 #ifdef HAVE_ELEMENTARY_X
-   _prop_config_set();
-   ecore_x_window_prop_string_set(_config_win, _atom[ATOM_E_PROFILE],
-                                  _elm_profile);
+        _prop_config_set();
+        ecore_x_window_prop_string_set(_config_win, _atom[ATOM_E_PROFILE],
+                                       _elm_profile);
 #endif
+     }
 }
 
 static void

-- 


Reply via email to