From 833d95b5da20c89bfd66e623d98f04fbf9b4fba1 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Tue, 20 Sep 2022 18:06:52 +0900 Subject: [PATCH] e_desk: add E_Desk_Zoom_Animating_Type information 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 | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/bin/e_desk.c b/src/bin/e_desk.c index 66553d3..34a4a30 100644 --- a/src/bin/e_desk.c +++ b/src/bin/e_desk.c @@ -15,6 +15,13 @@ 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); } -- 2.7.4