e_desk: add E_Desk_Zoom_Animating_Type information 88/281688/1 accepted/tizen/unified/20220921.170518
authorDoyoun Kang <doyoun.kang@samsung.com>
Tue, 20 Sep 2022 09:06:52 +0000 (18:06 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 21 Sep 2022 00:13:17 +0000 (09:13 +0900)
There was a bug that the disable zoom was not working while running zoom animation
first time.

We add E_Desk_Zoom_Animating_Type information to check an animation type which is
running currently.
For this information, we can control enable/disable zoom animation efficiently.

Change-Id: Ibced55bd644759515679ae4894bc55f326613302

src/bin/e_desk.c

index 66553d3..34a4a30 100644 (file)
 
 typedef struct _E_Desk_Smart_Data E_Desk_Smart_Data;
 
+typedef enum _E_Desk_Zoom_Animating_Type
+{
+   E_DESK_ZOOM_ANIMATING_TYPE_NONE,
+   E_DESK_ZOOM_ANIMATING_TYPE_ENABLE,
+   E_DESK_ZOOM_ANIMATING_TYPE_DISABLE,
+} E_Desk_Zoom_Animating_Type;
+
 struct _E_Desk_Smart_Data
 {
    Evas_Object_Smart_Clipped_Data base;
@@ -29,6 +36,7 @@ struct _E_Desk_Smart_Data
       int          prev_cord_x,  prev_cord_y;
       Eina_Bool    enabled;
       Ecore_Animator *animator;
+      E_Desk_Zoom_Animating_Type animating_type;
    } zoom;
 };
 
@@ -922,7 +930,7 @@ e_desk_geometry_set(E_Desk *desk, int x, int y, int w, int h)
 }
 
 static Eina_Bool
-_animator_cb(void *data, double pos)
+_e_desk_zoom_animate_cb(void *data, double pos)
 {
    E_Desk *desk;
    E_Client *ec;
@@ -974,6 +982,7 @@ _animator_cb(void *data, double pos)
              _e_desk_util_comp_hwc_disable_set(EINA_FALSE);
           }
 
+        sd->zoom.animating_type = E_DESK_ZOOM_ANIMATING_TYPE_NONE;
         sd->zoom.animator = NULL;
      }
 
@@ -1038,8 +1047,9 @@ e_desk_zoom_set(E_Desk *desk, double zoomx, double zoomy, int cx, int cy)
                        sd->zoom.animator = NULL;
                     }
 
+                  sd->zoom.animating_type = E_DESK_ZOOM_ANIMATING_TYPE_ENABLE;
                   sd->zoom.animator = ecore_animator_timeline_add(e_config->desk_zoom_effect.duration,
-                                                                  _animator_cb, desk);
+                                                                  _e_desk_zoom_animate_cb, desk);
                   _e_desk_object_zoom(desk->smart_obj, zoomx, zoomy, cx, cy);
                }
              else
@@ -1203,7 +1213,12 @@ e_desk_zoom_unset(E_Desk *desk)
         E_DESK_SMART_DATA_GET_OR_RETURN(desk->smart_obj, sd);
 
         if (!sd->zoom.enabled)
-          goto end;
+          {
+             if (sd->zoom.animating_type != E_DESK_ZOOM_ANIMATING_TYPE_ENABLE)
+               {
+                  goto end;
+               }
+          }
 
         sd->zoom.prev_ratio_x = sd->zoom.ratio_x;
         sd->zoom.prev_ratio_y = sd->zoom.ratio_y;
@@ -1224,8 +1239,9 @@ e_desk_zoom_unset(E_Desk *desk)
                   sd->zoom.animator = NULL;
                }
 
+             sd->zoom.animating_type = E_DESK_ZOOM_ANIMATING_TYPE_DISABLE;
              sd->zoom.animator = ecore_animator_timeline_add(e_config->desk_zoom_effect.duration,
-                                                             _animator_cb, desk);
+                                                             _e_desk_zoom_animate_cb, desk);
              _e_desk_object_zoom(desk->smart_obj, sd->zoom.ratio_x, sd->zoom.ratio_y,
                                  sd->zoom.cord_x, sd->zoom.cord_y);
           }