Pause adaptor when the window is hidden 30/156830/3
authorHeeyong Song <heeyong.song@samsung.com>
Fri, 20 Oct 2017 06:27:45 +0000 (15:27 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 25 Oct 2017 05:03:11 +0000 (14:03 +0900)
Change-Id: I28b2b86ee6593ee4546763e59d129ea68b083b21

adaptors/common/window-impl.h
adaptors/ecore/wayland/window-impl-ecore-wl.cpp
adaptors/wayland/window-impl-wl.cpp
adaptors/x11/window-impl-x.cpp

index 12de6a0d763ea4639e0464db5e087705d28cfefc..0f958715206931b65eb8b17c3d0432edde21f606 100644 (file)
@@ -428,6 +428,7 @@ private:
   bool                             mEcoreEventHander:1;
   bool                             mIsFocusAcceptable:1;
   bool                             mVisible:1;
+  bool                             mIconified:1;
   bool                             mOpaqueState:1;
   bool                             mResizeEnabled:1;
   IndicatorInterface*              mIndicator;
index 12ec48cfe99d3841708451ee31c385730baa74ac..d4265b40137ae405941bf5b1cb886ce70b236ff2 100644 (file)
@@ -155,12 +155,20 @@ struct Window::EventHandler
       {
         if( iconifyChangedEvent->iconified == EINA_TRUE )
         {
-          observer->OnWindowHidden();
+          handler->mWindow->mIconified = true;
+          if( handler->mWindow->mVisible )
+          {
+            observer->OnWindowHidden();
+          }
           DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) Iconfied\n", handler->mEcoreWindow );
         }
         else
         {
-          observer->OnWindowShown();
+          handler->mWindow->mIconified = false;
+          if( handler->mWindow->mVisible )
+          {
+            observer->OnWindowShown();
+          }
           DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) Shown\n", handler->mEcoreWindow );
         }
         handled = ECORE_CALLBACK_DONE;
@@ -497,6 +505,7 @@ Window::Window()
   mEcoreEventHander( true ),
   mIsFocusAcceptable( true ),
   mVisible( true ),
+  mIconified( false ),
   mOpaqueState( false ),
   mResizeEnabled( false ),
   mIndicator( NULL ),
@@ -875,10 +884,13 @@ void Window::Show()
   mVisible = true;
   ecore_wl_window_show( mEventHandler->mEcoreWindow );
 
-  // Need an update request
-  if( mAdaptor )
+  if( !mIconified )
   {
-    mAdaptor->RequestUpdateOnce();
+    if( mAdaptor )
+    {
+      WindowVisibilityObserver* observer( mAdaptor );
+      observer->OnWindowShown();
+    }
   }
 }
 
@@ -886,6 +898,15 @@ void Window::Hide()
 {
   mVisible = false;
   ecore_wl_window_hide( mEventHandler->mEcoreWindow );
+
+  if( !mIconified )
+  {
+    if( mAdaptor )
+    {
+      WindowVisibilityObserver* observer( mAdaptor );
+      observer->OnWindowHidden();
+    }
+  }
 }
 
 bool Window::IsVisible() const
index 875f5cb585461c197fbf6742cbb3480d09b3f1f0..d507f048a20ade5943534dfb791f4f5b86ea88e0 100644 (file)
@@ -111,6 +111,7 @@ Window::Window()
   mWMRotationAppSet( false ),
   mIsFocusAcceptable( true ),
   mVisible( true ),
+  mIconified( false ),
   mOpaqueState( false ),
   mResizeEnabled( true ),
   mIndicator( NULL ),
index 4820b3601614ce47ca8474882cb98398f4022876..0af5d4822c603354d97051d0fed4c80adf6d5718 100644 (file)
@@ -348,6 +348,7 @@ Window::Window()
   mEcoreEventHander( true ),
   mIsFocusAcceptable( true ),
   mVisible( true ),
+  mIconified( false ),
   mOpaqueState( false ),
   mResizeEnabled( true ),
   mIndicator( NULL ),