Fix the duplication in transient_for_set
authorChoi Munseok <ms47.choi@samsung.com>
Thu, 6 Jun 2013 23:23:52 +0000 (08:23 +0900)
committerChoi Munseok <ms47.choi@samsung.com>
Thu, 6 Jun 2013 23:23:52 +0000 (08:23 +0900)
Change-Id: I40fc46a78bb83c4bd4cfa59876b484015fbb607b
Signed-off-by: Choi Munseok <ms47.choi@samsung.com>
src/ui/FUi_EcoreEvas.cpp

index 9e85d5e..89c44dc 100644 (file)
@@ -1391,10 +1391,13 @@ _EcoreEvas::GetProcessId(unsigned int window)
 void
 _EcoreEvas::SetOwner(NativeWindowHandle ownee, NativeWindowHandle owner)
 {
-       ecore_x_icccm_transient_for_unset(ownee);
-       ecore_x_icccm_transient_for_set(ownee, owner);
-
-       SysLog(NID_UI, "[Window Order Group][Window : 0x%x] transient_for_set -> 0x%x", ownee, owner);
+       Ecore_X_Window win = ecore_x_icccm_transient_for_get(ownee);
+       if (win != owner)
+       {
+               ecore_x_icccm_transient_for_unset(ownee);
+               ecore_x_icccm_transient_for_set(ownee, owner);
+               SysLog(NID_UI, "[Window Order Group][Window : 0x%x] transient_for_set -> 0x%x", ownee, owner);
+       }
 }
 
 void
@@ -2385,9 +2388,13 @@ _EcoreEvas::SetOwner(const _Window& ownee, const _Control& owner)
        ecore_x_netwm_window_type_get(owneeWin, &type);
        if ((type == ECORE_X_WINDOW_TYPE_NORMAL) || (type == ECORE_X_WINDOW_TYPE_UTILITY))
        {
-               ecore_x_icccm_transient_for_unset(owneeWin);
-               ecore_x_icccm_transient_for_set(owneeWin, ownerWin);
-               SysLog(NID_UI, "[Window Order Group][Window : 0x%x] transient_for_set -> 0x%x", owneeWin, ownerWin);
+               Ecore_X_Window win = ecore_x_icccm_transient_for_get(owneeWin);
+               if (win != ownerWin)
+               {
+                       ecore_x_icccm_transient_for_unset(owneeWin);
+                       ecore_x_icccm_transient_for_set(owneeWin, ownerWin);
+                       SysLog(NID_UI, "[Window Order Group][Window : 0x%x] transient_for_set -> 0x%x", owneeWin, ownerWin);
+               }
        }
        else
        {