This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch main
in repository engage.

View the commit online.

commit 70b0e1508ab2a3e49f84af56c9b2e82d7453b62b
Author: Alastair Poole <[email protected]>
AuthorDate: Sat Nov 28 03:56:03 2026 +0000

    dock: add a timer to avoid creating many tooltips.
    
    Use a timer it looks crazy on fast mouse-over.
---
 engage_dock.c | 34 ++++++++++++++++++++++++++++++----
 1 file changed, 30 insertions(+), 4 deletions(-)

diff --git a/engage_dock.c b/engage_dock.c
index 3ce6ac9..2c76b04 100644
--- a/engage_dock.c
+++ b/engage_dock.c
@@ -62,6 +62,7 @@ typedef struct
    E_Client *client;
    Ecore_Animator *animation, *launch_animation;
    Ecore_Job *hover_job;
+   Ecore_Timer *tooltip_timer;
    double launch_pulse;
    double start, scale, target;
    int units, slot;
@@ -166,13 +167,37 @@ tile_section(const Dock_Tile *tile)
    return tile->client && !tile->temporary ? SECTION_WINDOWS : SECTION_LAUNCHERS;
 }
 
+static Eina_Bool
+tile_tooltip_show(void *data)
+{
+   Dock_Tile *tile = data;
+
+   tile->tooltip_timer = NULL;
+   tile->tooltip_visible = EINA_TRUE;
+   elm_object_tooltip_show(tile->tooltip_anchor);
+   return ECORE_CALLBACK_CANCEL;
+}
+
 static void
 tile_tooltip_visibility_set(Dock_Tile *tile, Eina_Bool visible)
 {
-   if (!tile->tooltip_anchor || tile->tooltip_visible == visible) return;
-   tile->tooltip_visible = visible;
-   if (visible) elm_object_tooltip_show(tile->tooltip_anchor);
-   else elm_object_tooltip_hide(tile->tooltip_anchor);
+   if (!tile->tooltip_anchor) return;
+   if (visible)
+     {
+        if (!tile->tooltip_visible && !tile->tooltip_timer)
+          tile->tooltip_timer = ecore_timer_add(0.125, tile_tooltip_show, tile);
+        return;
+     }
+   if (tile->tooltip_timer)
+     {
+        ecore_timer_del(tile->tooltip_timer);
+        tile->tooltip_timer = NULL;
+     }
+   if (tile->tooltip_visible)
+     {
+        tile->tooltip_visible = EINA_FALSE;
+        elm_object_tooltip_hide(tile->tooltip_anchor);
+     }
 }
 
 static void
@@ -345,6 +370,7 @@ tile_free(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
    if (tile->animation) ecore_animator_del(tile->animation);
    if (tile->launch_animation) ecore_animator_del(tile->launch_animation);
    if (tile->hover_job) ecore_job_del(tile->hover_job);
+   if (tile->tooltip_timer) ecore_timer_del(tile->tooltip_timer);
    if (tile->tooltip_anchor) evas_object_del(tile->tooltip_anchor);
    if (tile->preview_content) evas_object_del(tile->preview_content);
    evas_object_del(tile->visual);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to