Fix the runtime error by the uninitialized ecore imf event 54/42554/6
authordaemyung jang <dm86.jang@samsung.com>
Tue, 30 Jun 2015 04:48:47 +0000 (13:48 +0900)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Mon, 17 Aug 2015 16:26:00 +0000 (17:26 +0100)
Ecore IMF Version 1.13 has dev_name in the IMF struct, older versions do not, so adding a define to
check if we're at the right version and only setting the member if it does.

Change-Id: Ie462238c859295bd5c4291000f49f0219d1b2526

adaptors/x11/ecore-x-event-handler.cpp
build/tizen/configure.ac

index ccb2e9b..28313d5 100644 (file)
@@ -647,6 +647,9 @@ struct EventHandler::Impl
         ecoreKeyDownEvent.timestamp = keyEvent->timestamp;
         ecoreKeyDownEvent.modifiers = EcoreInputModifierToEcoreIMFModifier ( keyEvent->modifiers );
         ecoreKeyDownEvent.locks     = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE;
+#ifdef ECORE_IMF_1_13
+        ecoreKeyDownEvent.dev_name  = "";
+#endif // ECORE_IMF_1_13
 
         eventHandled = ecore_imf_context_filter_event( imfContext,
                                                        ECORE_IMF_EVENT_KEY_DOWN,
@@ -727,6 +730,9 @@ struct EventHandler::Impl
         ecoreKeyUpEvent.timestamp = keyEvent->timestamp;
         ecoreKeyUpEvent.modifiers = EcoreInputModifierToEcoreIMFModifier ( keyEvent->modifiers );
         ecoreKeyUpEvent.locks     = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE;
+#ifdef ECORE_IMF_1_13
+        ecoreKeyUpEvent.dev_name  = "";
+#endif // ECORE_IMF_1_13
 
         eventHandled = ecore_imf_context_filter_event( imfContext,
                                                        ECORE_IMF_EVENT_KEY_UP,
index 8980728..de9034c 100644 (file)
@@ -53,6 +53,7 @@ PKG_CHECK_MODULES(FRIBIDI, fribidi)
 PKG_CHECK_MODULES(TTRACE,  ttrace, AC_DEFINE(ENABLE_TTRACE, 1, [ttrace available]),
                   [ AC_MSG_NOTICE([Tizen Trace not avaiable]) ]
                   )
+PKG_CHECK_MODULES(ECORE_IMF, [ecore-imf >= 1.13], [ecore_imf_1_13=yes], [ecore_imf_1_13=no])
 
 
 # Check for EldBus.h in ECore
@@ -106,6 +107,11 @@ if test "x$enable_shaderbincache" = "xENABLE"; then
   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DSHADERBIN_CACHE_ENABLED"
 fi
 
+# If Ecore IMF version is greater than 1.13, then some structures are different
+if test "x$ecore_imf_1_13" = "xyes"; then
+  DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DECORE_IMF_1_13"
+fi
+
 AC_ARG_ENABLE([gles],
               [AC_HELP_STRING([--enable-gles],
                               [Specify the OpenGL ES version for backwards compatibility])],
@@ -277,6 +283,7 @@ Configuration
   EldBus:                           $eldbus_available
   Shader Binary Cache:              $enable_shaderbincache
   Build for Node.JS (LibUV)         $build_for_node_js
+  Ecore Version At Least 1.13.0     $ecore_imf_1_13
 "
 # optional output of node.js source path if we're building for node.js
 if test "x$build_for_node_js" != "xno"; then