From 909cb2be30fe5612df6f9877016ed871a3fa6438 Mon Sep 17 00:00:00 2001 From: Alastair Poole Date: Fri, 17 Apr 2020 21:13:27 +0100 Subject: [PATCH] e_shelf: Improve auto hide behaviour. Improve auto hide behaviour. Allow the user to re-enter an auto-hiding shelf as many times as he/she likes. This fixes the issue where hovering back onto such a configured shelf causes the shelf to hide and then animate. This needs to move to edje. As per the TODO task. --- TODO | 1 + src/bin/e_shelf.c | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 5d0e5a4ce..8d1e3e568 100644 --- a/TODO +++ b/TODO @@ -4,6 +4,7 @@ TODO: * winlist should do the switching with another layout mode... * shelf can expamnd/slow down to show more (indicator/notification) * gadget bar too... ? or just gad bar? + * shelf autohide. Move this to edje. * vkbd integrates with proper sizing and layout * manual show/hide with various controls (actions, swipes, gadget) * finger friendly desklock diff --git a/src/bin/e_shelf.c b/src/bin/e_shelf.c index e21c65dcc..f170d8fbc 100644 --- a/src/bin/e_shelf.c +++ b/src/bin/e_shelf.c @@ -159,6 +159,20 @@ _e_shelf_desk_count_handler(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Zone return ECORE_CALLBACK_RENEW; } +static Eina_Bool +_e_shelf_autohide_timer_extend(E_Shelf *es) +{ + if (es->autohide_timer && es->hide_timer) + { + ecore_timer_loop_reset(es->autohide_timer); + ecore_timer_loop_reset(es->hide_timer); + return EINA_TRUE; + } + ecore_timer_del(es->autohide_timer); + es->autohide_timer = NULL; + return EINA_FALSE; +} + /* externally accessible functions */ EINTERN int e_shelf_init(void) @@ -475,8 +489,7 @@ e_shelf_toggle(E_Shelf *es, int show) E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE); es->toggle = show; - if (es->autohide_timer) ecore_timer_del(es->autohide_timer); - es->autohide_timer = NULL; + if (_e_shelf_autohide_timer_extend(es)) return; if (es->locked) return; es->interrupted = -1; es->urgent_show = 0;