From: Shinwoo Kim Date: Mon, 2 May 2022 05:52:25 +0000 (+0900) Subject: [AT-SPI] remove unnecessary lines leading to crash X-Git-Tag: dali_2.1.21~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9dcb790b49225b39065808e428fb0a1fcb450cdf;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git [AT-SPI] remove unnecessary lines leading to crash The eldbus_connection_unref does not mean that the connection is released. So a signal hander of the connection should be removed if it is not used any more. We did not remove the signal hander but called only eldbus_connection_ref. So there was a crash with following stack. 0 Dali::BaseSignal::Emit (this=0x822f1b30, args#0=...) at /usr/include/dali/public-api/signals/base-signal.h:235 1 0xa4a6ca1b in Dali::Signal::Emit(Dali::Internal::Adaptor::WindowBase::AccessibilityInfo const&) (arg0=..., this=0x823b11a4) at /usr/include/dali/public-api/signals/dali-signal.h:531 2 Dali::Internal::Adaptor::WindowBaseEcoreWl2::OnEcoreElDBusAccessibilityNotification (this=0x823b1170, context=0x823b1170, message=0x820e83e0) at /home/abuild/rpmbuild/BUILD/dali2-adaptor-2.1.19/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp:1380 3 0xa4a6ca94 in Dali::Internal::Adaptor::(anonymous namespace)::EcoreElDBusAccessibilityNotification (context=0x823b1170, message=0x820e83e0) at /home/abuild/rpmbuild/BUILD/dali2-adaptor-2.1.19/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp:604 We do not use this signal on the AT-SPI world. So this patch removing unnecessary lines instead of calling the eldbus_signal_handler_del. Change-Id: I1df91170ca9bff1e369080ccac8046954948714e --- diff --git a/dali/internal/window-system/common/window-base.cpp b/dali/internal/window-system/common/window-base.cpp index e2b8707..155ca50 100644 --- a/dali/internal/window-system/common/window-base.cpp +++ b/dali/internal/window-system/common/window-base.cpp @@ -37,7 +37,6 @@ WindowBase::WindowBase() mSelectionDataSendSignal(), mSelectionDataReceivedSignal(), mStyleChangedSignal(), - mAccessibilitySignal(), mTransitionEffectEventSignal(), mKeyboardRepeatSettingsChangedSignal(), mUpdatePositionSizeSignal(), @@ -109,11 +108,6 @@ WindowBase::StyleSignalType& WindowBase::StyleChangedSignal() return mStyleChangedSignal; } -WindowBase::AccessibilitySignalType& WindowBase::AccessibilitySignal() -{ - return mAccessibilitySignal; -} - WindowBase::TransitionEffectEventSignalType& WindowBase::TransitionEffectEventSignal() { return mTransitionEffectEventSignal; diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index 8003802..6553348 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -85,7 +85,6 @@ public: // Accessibility typedef Signal StyleSignalType; - typedef Signal AccessibilitySignalType; /** * @brief Default constructor @@ -508,11 +507,6 @@ public: StyleSignalType& StyleChangedSignal(); /** - * @brief This signal is emitted when an accessibility event is received. - */ - AccessibilitySignalType& AccessibilitySignal(); - - /** * @brief This signal is emitted when window's transition animation is started or ended. */ TransitionEffectEventSignalType& TransitionEffectEventSignal(); @@ -557,7 +551,6 @@ protected: SelectionSignalType mSelectionDataSendSignal; SelectionSignalType mSelectionDataReceivedSignal; StyleSignalType mStyleChangedSignal; - AccessibilitySignalType mAccessibilitySignal; TransitionEffectEventSignalType mTransitionEffectEventSignal; KeyboardRepeatSettingsChangedSignalType mKeyboardRepeatSettingsChangedSignal; WindowRedrawRequestSignalType mWindowRedrawRequestSignal; diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp index 42a522c..c0b56f8 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp @@ -441,22 +441,6 @@ static void VconfNotifyFontSizeChanged(keynode_t* node, void* data) } } -///////////////////////////////////////////////////////////////////////////////////////////////// -// ElDBus Accessibility Callbacks -///////////////////////////////////////////////////////////////////////////////////////////////// - -#ifdef DALI_ELDBUS_AVAILABLE -// Callback for Ecore ElDBus accessibility events. -static void EcoreElDBusAccessibilityNotification(void* context, const Eldbus_Message* message) -{ - WindowBaseEcoreWl* windowBase = static_cast(context); - if(windowBase) - { - windowBase->OnEcoreElDBusAccessibilityNotification(context, message); - } -} -#endif // DALI_ELDBUS_AVAILABLE - static void RegistryGlobalCallback(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version) { WindowBaseEcoreWl* windowBase = static_cast(data); @@ -582,24 +566,12 @@ WindowBaseEcoreWl::WindowBaseEcoreWl(Dali::PositionSize positionSize, Any surfac mWindowRotationAngle(0), mScreenRotationAngle(0), mSupportedPreProtation(0) -#ifdef DALI_ELDBUS_AVAILABLE - , - mSystemConnection(NULL) -#endif { Initialize(positionSize, surface, isTransparent); } WindowBaseEcoreWl::~WindowBaseEcoreWl() { -#ifdef DALI_ELDBUS_AVAILABLE - // Close down ElDBus connections. - if(mSystemConnection) - { - eldbus_connection_unref(mSystemConnection); - } -#endif // DALI_ELDBUS_AVAILABLE - vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged); vconf_ignore_key_changed(DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged); @@ -686,8 +658,6 @@ void WindowBaseEcoreWl::Initialize(PositionSize positionSize, Any surface, bool vconf_notify_key_changed(DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged, this); vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged, this); - InitializeEcoreElDBus(); - mDisplay = ecore_wl_display_get(); if(mDisplay) @@ -1098,21 +1068,6 @@ void WindowBaseEcoreWl::OnFontSizeChanged() mStyleChangedSignal.Emit(StyleChange::DEFAULT_FONT_SIZE_CHANGE); } -void WindowBaseEcoreWl::OnEcoreElDBusAccessibilityNotification(void* context, const Eldbus_Message* message) -{ -#ifdef DALI_ELDBUS_AVAILABLE - AccessibilityInfo info; - - // The string defines the arg-list's respective types. - if(!eldbus_message_arguments_get(message, "iiiiiiu", &info.gestureValue, &info.startX, &info.startY, &info.endX, &info.endY, &info.state, &info.eventTime)) - { - DALI_LOG_ERROR("OnEcoreElDBusAccessibilityNotification: Error getting arguments\n"); - } - - mAccessibilitySignal.Emit(info); -#endif -} - void WindowBaseEcoreWl::RegistryGlobalCallback(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version) { if(strcmp(interface, tizen_policy_interface.name) == 0) @@ -2140,38 +2095,6 @@ void WindowBaseEcoreWl::SetTransparency(bool transparent) ecore_wl_window_alpha_set(mEcoreWindow, transparent); } -void WindowBaseEcoreWl::InitializeEcoreElDBus() -{ -#ifdef DALI_ELDBUS_AVAILABLE - Eldbus_Object* object; - Eldbus_Proxy* manager; - - if(!(mSystemConnection = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM))) - { - DALI_LOG_ERROR("Unable to get system bus\n"); - } - - object = eldbus_object_get(mSystemConnection, BUS, PATH); - if(!object) - { - DALI_LOG_ERROR("Getting object failed\n"); - return; - } - - manager = eldbus_proxy_get(object, INTERFACE); - if(!manager) - { - DALI_LOG_ERROR("Getting proxy failed\n"); - return; - } - - if(!eldbus_proxy_signal_handler_add(manager, "GestureDetected", EcoreElDBusAccessibilityNotification, this)) - { - DALI_LOG_ERROR("No signal handler returned\n"); - } -#endif -} - void WindowBaseEcoreWl::CreateWindow(PositionSize positionSize) { mEcoreWindow = ecore_wl_window_new(0, positionSize.x, positionSize.y, positionSize.width, positionSize.height, ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW); diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h index d2dad57..f44b0c1 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h @@ -27,10 +27,6 @@ #include #include -#ifdef DALI_ELDBUS_AVAILABLE -#include -#endif - namespace Dali { namespace Internal @@ -147,13 +143,6 @@ public: */ void OnFontSizeChanged(); -#ifdef DALI_ELDBUS_AVAILABLE - /** - * @brief Called when Ecore ElDBus accessibility event is received. - */ - void OnEcoreElDBusAccessibilityNotification(void* context, const Eldbus_Message* message); -#endif - /** * @brief RegistryGlobalCallback */ @@ -512,11 +501,6 @@ private: void Initialize(PositionSize positionSize, Any surface, bool isTransparent); /** - * Initialize Ecore ElDBus - */ - void InitializeEcoreElDBus(); - - /** * @brief Create window */ void CreateWindow(PositionSize positionSize); @@ -561,9 +545,6 @@ private: int mWindowRotationAngle; int mScreenRotationAngle; int mSupportedPreProtation; -#ifdef DALI_ELDBUS_AVAILABLE - Eldbus_Connection* mSystemConnection; -#endif // DALI_ELDBUS_AVAILABLE }; } // namespace Adaptor diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index 32d87c0..e9fc0ba 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -55,13 +55,6 @@ const unsigned int PRIMARY_TOUCH_BUTTON_ID = 1; const char* DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME = "db/setting/accessibility/font_name"; // It will be update at vconf-key.h and replaced. -#ifdef DALI_ELDBUS_AVAILABLE -// DBUS accessibility -const char* BUS = "org.enlightenment.wm-screen-reader"; -const char* INTERFACE = "org.tizen.GestureNavigation"; -const char* PATH = "/org/tizen/GestureNavigation"; -#endif // DALI_ELDBUS_AVAILABLE - struct KeyCodeMap { xkb_keysym_t keySym; @@ -590,22 +583,6 @@ static Eina_Bool EcoreEventWindowAuxiliaryMessage(void* data, int type, void* ev return ECORE_CALLBACK_RENEW; } -///////////////////////////////////////////////////////////////////////////////////////////////// -// ElDBus Accessibility Callbacks -///////////////////////////////////////////////////////////////////////////////////////////////// - -#ifdef DALI_ELDBUS_AVAILABLE -// Callback for Ecore ElDBus accessibility events. -static void EcoreElDBusAccessibilityNotification(void* context, const Eldbus_Message* message) -{ - WindowBaseEcoreWl2* windowBase = static_cast(context); - if(windowBase) - { - windowBase->OnEcoreElDBusAccessibilityNotification(context, message); - } -} -#endif // DALI_ELDBUS_AVAILABLE - static void RegistryGlobalCallback(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version) { WindowBaseEcoreWl2* windowBase = static_cast(data); @@ -742,24 +719,12 @@ WindowBaseEcoreWl2::WindowBaseEcoreWl2(Dali::PositionSize positionSize, Any surf mVisible(true), mOwnSurface(false), mBrightnessChangeDone(true) -#ifdef DALI_ELDBUS_AVAILABLE - , - mSystemConnection(NULL) -#endif { Initialize(positionSize, surface, isTransparent); } WindowBaseEcoreWl2::~WindowBaseEcoreWl2() { -#ifdef DALI_ELDBUS_AVAILABLE - // Close down ElDBus connections. - if(mSystemConnection) - { - eldbus_connection_unref(mSystemConnection); - } -#endif // DALI_ELDBUS_AVAILABLE - vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged); vconf_ignore_key_changed(DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged); @@ -862,8 +827,6 @@ void WindowBaseEcoreWl2::Initialize(PositionSize positionSize, Any surface, bool vconf_notify_key_changed(DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged, this); vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged, this); - InitializeEcoreElDBus(); - Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL); mDisplay = ecore_wl2_display_get(display); @@ -1366,21 +1329,6 @@ void WindowBaseEcoreWl2::OnFontSizeChanged() mStyleChangedSignal.Emit(StyleChange::DEFAULT_FONT_SIZE_CHANGE); } -#ifdef DALI_ELDBUS_AVAILABLE -void WindowBaseEcoreWl2::OnEcoreElDBusAccessibilityNotification(void* context, const Eldbus_Message* message) -{ - AccessibilityInfo info; - - // The string defines the arg-list's respective types. - if(!eldbus_message_arguments_get(message, "iiiiiiu", &info.gestureValue, &info.startX, &info.startY, &info.endX, &info.endY, &info.state, &info.eventTime)) - { - DALI_LOG_ERROR("OnEcoreElDBusAccessibilityNotification: Error getting arguments\n"); - } - - mAccessibilitySignal.Emit(info); -} -#endif // DALI_ELDBUS_AVAILABLE - void WindowBaseEcoreWl2::OnTransitionEffectEvent(WindowEffectState state, WindowEffectType type) { mTransitionEffectEventSignal.Emit(state, type); @@ -2605,38 +2553,6 @@ void WindowBaseEcoreWl2::SetTransparency(bool transparent) ecore_wl2_window_alpha_set(mEcoreWindow, transparent); } -void WindowBaseEcoreWl2::InitializeEcoreElDBus() -{ -#ifdef DALI_ELDBUS_AVAILABLE - Eldbus_Object* object; - Eldbus_Proxy* manager; - - if(!(mSystemConnection = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM))) - { - DALI_LOG_ERROR("Unable to get system bus\n"); - } - - object = eldbus_object_get(mSystemConnection, BUS, PATH); - if(!object) - { - DALI_LOG_ERROR("Getting object failed\n"); - return; - } - - manager = eldbus_proxy_get(object, INTERFACE); - if(!manager) - { - DALI_LOG_ERROR("Getting proxy failed\n"); - return; - } - - if(!eldbus_proxy_signal_handler_add(manager, "GestureDetected", EcoreElDBusAccessibilityNotification, this)) - { - DALI_LOG_ERROR("No signal handler returned\n"); - } -#endif -} - void WindowBaseEcoreWl2::CreateWindow(PositionSize positionSize) { Ecore_Wl2_Display* display = ecore_wl2_display_connect(NULL); diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index 06caf19..c51b563 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -29,10 +29,6 @@ #include #include -#ifdef DALI_ELDBUS_AVAILABLE -#include -#endif - namespace Dali { namespace Internal @@ -176,13 +172,6 @@ public: */ void OnEcoreEventWindowAuxiliaryMessage(void* event); -#ifdef DALI_ELDBUS_AVAILABLE - /** - * @brief Called when Ecore ElDBus accessibility event is received. - */ - void OnEcoreElDBusAccessibilityNotification(void* context, const Eldbus_Message* message); -#endif - /** * @brief Called when a keymap is changed. */ @@ -551,11 +540,6 @@ private: void Initialize(PositionSize positionSize, Any surface, bool isTransparent); /** - * Initialize Ecore ElDBus - */ - void InitializeEcoreElDBus(); - - /** * @brief Create window */ void CreateWindow(PositionSize positionSize); @@ -638,10 +622,6 @@ private: bool mVisible : 1; bool mOwnSurface; bool mBrightnessChangeDone; - -#ifdef DALI_ELDBUS_AVAILABLE - Eldbus_Connection* mSystemConnection; -#endif // DALI_ELDBUS_AVAILABLE }; } // namespace Adaptor