Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / ubuntu-x11 / window-base-ecore-x.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 5f92464..4ff9d56
@@ -29,6 +29,7 @@
 
 // EXTERNAL_HEADERS
 #include <dali/public-api/object/any.h>
+#include <dali/public-api/events/mouse-button.h>
 #include <dali/integration-api/debug.h>
 #include <Ecore_Input.h>
 
@@ -249,6 +250,7 @@ WindowBaseEcoreX::WindowBaseEcoreX( Dali::PositionSize positionSize, Any surface
 : mEcoreEventHandler(),
   mEcoreWindow( 0 ),
   mOwnSurface( false ),
+  mIsTransparent( false ), // Should only be set to true once we actually create a transparent window regardless of what isTransparent is.
   mRotationAppSet( false )
 {
   Initialize( positionSize, surface, isTransparent );
@@ -438,14 +440,6 @@ void WindowBaseEcoreX::OnMouseButtonDown( void* data, int type, void* event )
   {
     PointState::Type state ( PointState::DOWN );
 
-    // Check if the buttons field is set and ensure it's the primary touch button.
-    // If this event was triggered by buttons other than the primary button (used for touch), then
-    // just send an interrupted event to Core.
-    if( touchEvent->buttons && ( touchEvent->buttons != PRIMARY_TOUCH_BUTTON_ID ) )
-    {
-      state = PointState::INTERRUPTED;
-    }
-
     Integration::Point point;
     point.SetDeviceId( touchEvent->multi.device );
     point.SetState( state );
@@ -453,6 +447,10 @@ void WindowBaseEcoreX::OnMouseButtonDown( void* data, int type, void* event )
     point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
     point.SetPressure( touchEvent->multi.pressure );
     point.SetAngle( Degree( touchEvent->multi.angle ) );
+    if( touchEvent->buttons)
+    {
+      point.SetMouseButton( static_cast< MouseButton::Type >( touchEvent->buttons) );
+    }
 
     mTouchEventSignal.Emit( point, touchEvent->timestamp );
   }
@@ -471,6 +469,10 @@ void WindowBaseEcoreX::OnMouseButtonUp( void* data, int type, void* event )
     point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
     point.SetPressure( touchEvent->multi.pressure );
     point.SetAngle( Degree( touchEvent->multi.angle ) );
+    if( touchEvent->buttons)
+    {
+      point.SetMouseButton( static_cast< MouseButton::Type >( touchEvent->buttons) );
+    }
 
     mTouchEventSignal.Emit( point, touchEvent->timestamp );
   }
@@ -864,17 +866,6 @@ void WindowBaseEcoreX::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVer
   dpiVertical   = int( yres + 0.5f );
 }
 
-void WindowBaseEcoreX::SetViewMode( ViewMode viewMode )
-{
-  Ecore_X_Atom viewModeAtom( ecore_x_atom_get( "_E_COMP_3D_APP_WIN" ) );
-
-  if( viewModeAtom != None )
-  {
-    unsigned int value( static_cast< unsigned int >( viewMode ) );
-    ecore_x_window_prop_card32_set( mEcoreWindow, viewModeAtom, &value, 1 );
-  }
-}
-
 int WindowBaseEcoreX::GetScreenRotationAngle()
 {
   return 0;
@@ -920,6 +911,7 @@ void WindowBaseEcoreX::CreateWindow( PositionSize positionSize, bool isTranspare
  {
    // create 32 bit window
    mEcoreWindow = ecore_x_window_argb_new( 0, positionSize.x, positionSize.y, positionSize.width, positionSize.height );
+   mIsTransparent = true;
  }
  else
  {