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 d63244b33fab01165b020fa2537951f036ab391c
Author: Alastair Poole <[email protected]>
AuthorDate: Wed Nov 25 12:51:33 2026 +0000

    dock: clamp resize.
---
 README.md     | 10 ++--------
 engage_dock.c | 30 +++++++++++++++++++-----------
 2 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/README.md b/README.md
index fa78540..98ff899 100644
--- a/README.md
+++ b/README.md
@@ -4,17 +4,11 @@ Engage is an Enlightenment module with reorderable app icons and frozen previews
 
 ![Engage dock mockup with application icons, running indicators, and minimized window previews](docs/engage-dock-mockup.png)
 
-Enabling the module opens a single standalone dock at the bottom center of the primary active display. It follows the primary display when the display configuration changes and shows minimized windows from all workspaces and displays. Maximized windows stop above the dock, and dragging windows against it uses Enlightenment’s shelf resistance settings. When upgrading an existing dock, Engage carries over its saved size and calculates its position from the primary display.
-
-Drag pinned and running app icons to reorder them. Pinned launcher order is saved, and unpinned icons disappear when their apps close.
-
-Drag the divider vertically to scale the dock and its icons. Drag horizontally to adjust the width, or diagonally to combine both adjustments. Engage saves both dimensions and widens the dock as needed to keep icons at the size set by its height. Icons shrink when the display runs out of room.
-
-Right-click the dock and choose **Settings** to preview Enlightenment shelf styles and adjust the shelf background transparency. Changes take effect immediately and are saved automatically.
+This module enforces a macOS workflow. There is one instance across all displays and workspaces.
 
 ## Build and install
 
-Install a C compiler, Meson, Ninja, pkg-config, the development files for your installed version of Enlightenment and EFL, and the EFL Edje compiler (`edje_cc`). XCB development files are optional and enable X11 window preview capture.
+Install a C compiler, Meson, Ninja, pkg-config, the development files for your installed version of Enlightenment and EFL.
 
 From the repository root, run these commands.
 
diff --git a/engage_dock.c b/engage_dock.c
index c2369e1..69207cb 100644
--- a/engage_dock.c
+++ b/engage_dock.c
@@ -889,18 +889,19 @@ dock_units_get(const Engage_Dock *dock)
    return MAX(ICON_UNITS, units);
 }
 
+static int
+dock_slot_extra_width(void)
+{
+   int icon_gap = MAX(1, lround(2 * e_scale));
+   int along_gap = MAX(1, lround(6 * e_scale));
+   return MAX(0, along_gap - 2 * icon_gap);
+}
+
 static int
 dock_fit_width(const Engage_Dock *dock)
 {
-   double height;
-   int icon_gap;
-   int along_gap;
-   double slot_width;
-
-   height = MIN(dock->height * e_scale, dock->zone->h - dock_shadow_depth(dock));
-   icon_gap = MAX(1, lround(2 * e_scale));
-   along_gap = MAX(1, lround(6 * e_scale));
-   slot_width = height + MAX(0, along_gap - 2 * icon_gap);
+   double height = MIN(dock->height * e_scale, dock->zone->h - dock_shadow_depth(dock));
+   double slot_width = height + dock_slot_extra_width();
    return ceil(slot_width * dock_units_get(dock) / ICON_UNITS) + 2 * dock_padding();
 }
 
@@ -912,13 +913,20 @@ divider_drag(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
    Evas_Event_Mouse_Move *ev;
    int height;
    int width;
+   int max_height;
+   int max_height_setting;
 
    dock = data;
    ev = event;
    if (!dock->resizing || !(ev->buttons & 1)) return;
 
    height = dock->resize_thickness + dock->resize_y - ev->cur.canvas.y;
-   height = MIN(MAX(lround(24 * e_scale), height), dock->zone->h - dock_shadow_depth(dock));
+   max_height = (int)((int64_t)(dock_max_width(dock) - 2 * dock_padding()) *
+                      ICON_UNITS / dock_units_get(dock)) - dock_slot_extra_width();
+   max_height = MIN(max_height, dock->zone->h - dock_shadow_depth(dock));
+   max_height_setting = MAX(1, (int)floor(max_height / e_scale));
+   height = MIN(MAX(lround(24 * e_scale), height),
+                MAX(1, lround(max_height_setting * e_scale)));
    if (dock->width > 0 || ev->cur.canvas.x != ev->prev.canvas.x)
      {
         width = lround((double)dock->resize_length * height / dock->resize_thickness);
@@ -927,7 +935,7 @@ divider_drag(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
         dock->width = MAX(1, lround(width / e_scale));
      }
    if (ev->cur.canvas.y != ev->prev.canvas.y)
-     dock->height = MAX(1, lround(height / e_scale));
+     dock->height = MIN(max_height_setting, MAX(1, lround(height / e_scale)));
    dock_size(dock);
 }
 

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

Reply via email to