- Indicator::OnPan() code is unreachable because of 'return;' in ecore-indicator-impl
- Pointer 'info' returned from function 'malloc' at key-grab-ecore-wl may be null
Change-Id: I00e09c05319485e26a89b5d2658d9c82c7e0c42b
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
void Indicator::OnPan( Dali::Actor actor, const Dali::PanGesture& gesture )
{
- return ;
-
- if( mServerConnection )
- {
- switch( gesture.state )
- {
- case Gesture::Started:
- {
- mGestureDetected = false;
-
- // The gesture position is the current position after it has moved by the displacement.
- // We want to reference the original position.
- mGestureDeltaY = gesture.position.y - gesture.displacement.y;
- }
-
- // No break, Fall through
- case Gesture::Continuing:
- {
- if( mVisible == Dali::Window::AUTO && !mIsShowing )
- {
- // Only take one touch point
- if( gesture.numberOfTouches == 1 && mGestureDetected == false )
- {
- mGestureDeltaY += gesture.displacement.y;
-
- if( mGestureDeltaY >= mImageHeight * SHOWING_DISTANCE_HEIGHT_RATE )
- {
- ShowIndicator( AUTO_INDICATOR_STAY_DURATION );
- mGestureDetected = true;
- }
- }
- }
-
- break;
- }
-
- case Gesture::Finished:
- case Gesture::Cancelled:
- {
- // if indicator is showing, hide again when touching is finished (Since touch leave is activated, checking it in gesture::finish instead of touch::up)
- if( mVisible == Dali::Window::AUTO && mIsShowing )
- {
- ShowIndicator( AUTO_INDICATOR_STAY_DURATION );
- }
- break;
- }
-
-
- default:
- break;
- }
- }
+ // Nothing to do, but we still want to consume pan
}
void Indicator::OnStageTouched(const Dali::TouchData& touchData)
for( Dali::Vector<float>::SizeType index = 0; index < keyCount; ++index )
{
Ecore_Wl_Window_Keygrab_Info *info = (Ecore_Wl_Window_Keygrab_Info*)malloc(sizeof(Ecore_Wl_Window_Keygrab_Info));
- info->key = (char*)Dali::Internal::Adaptor::KeyLookup::GetKeyName( daliKeyVector[index] );
-
- switch(grabModeVector[index])
+ if( info )
{
- case TOPMOST:
- info->mode = ECORE_WL_WINDOW_KEYGRAB_TOPMOST;
- break;
- case SHARED:
- info->mode = ECORE_WL_WINDOW_KEYGRAB_SHARED;
- break;
- case OVERRIDE_EXCLUSIVE:
- info->mode = ECORE_WL_WINDOW_KEYGRAB_EXCLUSIVE;
- break;
- case EXCLUSIVE:
- info->mode = ECORE_WL_WINDOW_KEYGRAB_OVERRIDE_EXCLUSIVE;
- break;
- default:
- info->mode = ECORE_WL_WINDOW_KEYGRAB_UNKNOWN;
- break;
- }
+ info->key = (char*)Dali::Internal::Adaptor::KeyLookup::GetKeyName( daliKeyVector[index] );
+
+ switch(grabModeVector[index])
+ {
+ case TOPMOST:
+ info->mode = ECORE_WL_WINDOW_KEYGRAB_TOPMOST;
+ break;
+ case SHARED:
+ info->mode = ECORE_WL_WINDOW_KEYGRAB_SHARED;
+ break;
+ case OVERRIDE_EXCLUSIVE:
+ info->mode = ECORE_WL_WINDOW_KEYGRAB_EXCLUSIVE;
+ break;
+ case EXCLUSIVE:
+ info->mode = ECORE_WL_WINDOW_KEYGRAB_OVERRIDE_EXCLUSIVE;
+ break;
+ default:
+ info->mode = ECORE_WL_WINDOW_KEYGRAB_UNKNOWN;
+ break;
+ }
- keyList = eina_list_append(keyList, info);
+ keyList = eina_list_append(keyList, info);
+ }
}
grabList = ecore_wl_window_keygrab_list_set(AnyCast<Ecore_Wl_Window*>( window.GetNativeHandle() ), keyList);
for( Dali::Vector<float>::SizeType index = 0; index < keyCount; ++index )
{
Ecore_Wl_Window_Keygrab_Info *info = (Ecore_Wl_Window_Keygrab_Info*)malloc(sizeof(Ecore_Wl_Window_Keygrab_Info));
- info->key = (char*)Dali::Internal::Adaptor::KeyLookup::GetKeyName( daliKeyVector[index] );
- keyList = eina_list_append(keyList, info);
+ if( info )
+ {
+ info->key = (char*)Dali::Internal::Adaptor::KeyLookup::GetKeyName( daliKeyVector[index] );
+ keyList = eina_list_append(keyList, info);
+ }
}
ungrabList = ecore_wl_window_keygrab_list_unset(AnyCast<Ecore_Wl_Window*>( window.GetNativeHandle() ), keyList);
void Indicator::OnPan( Dali::Actor actor, const Dali::PanGesture& gesture )
{
- return ;
-
- if( mServerConnection )
- {
- switch( gesture.state )
- {
- case Gesture::Started:
- {
- mGestureDetected = false;
-
- // The gesture position is the current position after it has moved by the displacement.
- // We want to reference the original position.
- mGestureDeltaY = gesture.position.y - gesture.displacement.y;
- }
-
- // No break, Fall through
- case Gesture::Continuing:
- {
- if( mVisible == Dali::Window::AUTO && !mIsShowing )
- {
- // Only take one touch point
- if( gesture.numberOfTouches == 1 && mGestureDetected == false )
- {
- mGestureDeltaY += gesture.displacement.y;
-
- if( mGestureDeltaY >= mImageHeight * SHOWING_DISTANCE_HEIGHT_RATE )
- {
- ShowIndicator( AUTO_INDICATOR_STAY_DURATION );
- mGestureDetected = true;
- }
- }
- }
-
- break;
- }
-
- case Gesture::Finished:
- case Gesture::Cancelled:
- {
- // if indicator is showing, hide again when touching is finished (Since touch leave is activated, checking it in gesture::finish instead of touch::up)
- if( mVisible == Dali::Window::AUTO && mIsShowing )
- {
- ShowIndicator( AUTO_INDICATOR_STAY_DURATION );
- }
- break;
- }
-
-
- default:
- break;
- }
- }
+ // Nothing to do, but we still want to consume pan
}
void Indicator::OnStageTouched(const Dali::TouchData& touchData)