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 42485492d8170925c3a8ba594bf5576cb9aa0888
Author: Alastair Poole <[email protected]>
AuthorDate: Tue Nov 24 18:06:02 2026 +0000

    icons: move em all close some
---
 engage_dock.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 76 insertions(+), 4 deletions(-)

diff --git a/engage_dock.c b/engage_dock.c
index fa0405b..bcf2ad8 100644
--- a/engage_dock.c
+++ b/engage_dock.c
@@ -162,13 +162,13 @@ tile_click(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
 static Eina_Bool
 tile_reorderable(const Dock_Tile *tile)
 {
-   return !tile->temporary && (tile->app || tile->client);
+   return tile->app || tile->client;
 }
 
 static Dock_Section
 tile_section(const Dock_Tile *tile)
 {
-   return tile->client ? SECTION_WINDOWS : SECTION_LAUNCHERS;
+   return tile->client && !tile->temporary ? SECTION_WINDOWS : SECTION_LAUNCHERS;
 }
 
 static void
@@ -574,9 +574,31 @@ static Eina_Bool
 dock_save_drop(Dock_Tile *tile, int child_index)
 {
    Engage_Dock *dock = tile->dock;
-   if (tile->app) return engage_launchers_move(dock->from, dock->target);
+   if (tile->temporary) return EINA_TRUE;
 
    Eina_List *children = evas_object_box_children_get(dock->box);
+   if (tile->app)
+     {
+        Eina_List *l;
+        Evas_Object *child;
+        int index = 0, pinned = 0, from = 0, target = 0;
+        EINA_LIST_FOREACH(children, l, child)
+          {
+             Dock_Tile *entry = evas_object_data_get(child, "engage.tile");
+             if (entry == tile) from = pinned;
+             if (entry->app && !entry->temporary)
+               {
+                  if ((index < child_index && entry != tile) ||
+                      (index == child_index && dock->target > dock->from))
+                    target++;
+                  pinned++;
+               }
+             index++;
+          }
+        eina_list_free(children);
+        return from == target || engage_launchers_move(from, target);
+     }
+
    Evas_Object *hit = eina_list_nth(children, child_index);
    Dock_Tile *anchor = hit ? evas_object_data_get(hit, "engage.tile") : NULL;
    eina_list_free(children);
@@ -1001,7 +1023,15 @@ dock_fill(Engage_Dock *dock)
 
    dock->rebuild_pending = EINA_FALSE;
    divider_cursor_set(dock, EINA_FALSE);
-   dock_tiles_clear(dock);
+   Eina_List *old_children = evas_object_box_children_get(dock->box);
+   Eina_List *entry;
+   Evas_Object *child;
+   EINA_LIST_FOREACH(old_children, entry, child)
+     {
+        elm_object_tooltip_unset(child);
+        evas_object_hide(child);
+     }
+   evas_object_box_remove_all(dock->box, EINA_FALSE);
    const Eina_List *launchers = engage_launchers_list();
    EINA_LIST_FOREACH(launchers, l, app)
      dock_add(dock, app, NULL, TILE_STANDARD);
@@ -1013,6 +1043,48 @@ dock_fill(Engage_Dock *dock)
         app = engage_launcher_desktop_for_window(ec);
         dock_add(dock, app, app ? NULL : ec, TILE_RUNNING);
      }
+   /* Restore running icons in their previous slots when they still exist. */
+   Eina_List *children = evas_object_box_children_get(dock->box);
+   int first_icon = launchers ? 0 : 1;
+   int pinned_remaining = eina_list_count(launchers);
+   int slot = first_icon;
+   EINA_LIST_FREE(old_children, child)
+     {
+        Dock_Tile *old = evas_object_data_get(child, "engage.tile");
+        if (old->temporary)
+          {
+             Evas_Object *candidate;
+             EINA_LIST_FOREACH(children, entry, candidate)
+               {
+                  Dock_Tile *tile = evas_object_data_get(candidate, "engage.tile");
+                  if (!tile->temporary) continue;
+                  if (old->app && tile->app)
+                    {
+                       if (old->app != tile->app &&
+                           (!old->app->orig_path || !tile->app->orig_path ||
+                            strcmp(old->app->orig_path, tile->app->orig_path))) continue;
+                    }
+                  else if (!old->client || old->client != tile->client) continue;
+
+                  evas_object_box_remove(dock->box, candidate);
+                  if (!evas_object_box_insert_at(dock->box, candidate, slot) &&
+                      !evas_object_box_append(dock->box, candidate))
+                    {
+                       children = eina_list_remove_list(children, entry);
+                       evas_object_del(candidate);
+                    }
+                  slot++;
+                  break;
+               }
+          }
+        else if (old->app && pinned_remaining > 0)
+          {
+             pinned_remaining--;
+             slot++;
+          }
+        evas_object_del(child);
+     }
+   eina_list_free(children);
    dock_add(dock, NULL, NULL, TILE_DIVIDER);
 
    EINA_LIST_FOREACH(engage_windows_collect(), l, ec)

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

Reply via email to