EdgeSnap: Window Snapping for AmigaOS 4 and MorphOS

EdgeSnap is an open source project that brings window snapping, similar to the behaviour found on Windows and macOS, to AmigaOS 4.x and MorphOS. The idea is simple: drag a window towards a screen edge or corner, see a preview of the target area, and release it to place the window in half or a quarter of the available space.

I developed EdgeSnap in C89, and the beta 0.1 release is now available on Aminet. The source code is available on GitHub, where development continues and users can report problems. Behind the visible preview frame is an attempt to turn a small utility into a shared service for Amiga-like window management.

It is not intended for AmigaOS 3.x

The first distinction is important. EdgeSnap is not meant to replace GoSnap, which remains the reference for the classic AmigaOS 3.x use case. This project starts with AmigaOS 4.x and MorphOS, modern Amiga-like environments with docks and panels, compositing where available, ReAction or MUI, and a commodity and library model that allows broader integration.

The difference is not only the list of supported systems. EdgeSnap also addresses problems that appear when snapping becomes an everyday feature: avoiding docks, remembering previous geometry, showing a preview before release, and resizing two windows together after they have been placed side by side.

From dragging to an adjustable layout

The main gesture starts with dragging a window title bar. When EdgeSnap detects that the window is following the pointer, it checks the mouse position against the usable screen area:

  • left and right edges create two vertical halves;
  • corners create four quarter-screen zones;
  • the top edge maximises the window;
  • releasing outside a zone leaves the window free.

The preview does not immediately change the window. It shows the expected geometry using a four-bar frame. On MorphOS this is implemented with thin, non-activating windows, while AmigaOS 4 uses an XOR outline, which is more reliable during dragging in QEMU and on systems without useful compositing.

The most distinctive feature is the divider. When two windows have been placed side by side, EdgeSnap can show a handle on their shared edge. Dragging it resizes both windows together: a 50/50 split can become 60/40 without opening the individual applications’ sizing gadgets. Snapping therefore does not end with positioning; it creates a small layout that can still be adjusted.

The dock must not become a hidden window

On AmigaOS and MorphOS, the usable area is not necessarily the entire screen. A dock or panel can sit at the top, bottom or side, including as a floating window. EdgeSnap therefore tries to detect strips with the typical shape of a panel and subtracts them from the available geometry, adding a small margin as well.

Detection is not based only on the window name. The portable core classifies shape, thickness, length and position near the screen edge, while native code filters windows that should not be mistaken for a dock, such as draggable or resizable application windows and backdrops. The behaviour has already been checked with a raised floating panel on MorphOS. Real AmiDock layouts on AmigaOS 4 and auto-hidden docks still need broader validation.

The architectural choice: a library, not just a commodity

This is what makes EdgeSnap more interesting than an ordinary hotkey utility. The main product is intended to be edgesnap.library. The commodity is the first client: it collects events, draws the preview and passes the necessary facts to the library. Decisions about zones, geometry, state and restoration remain in one engine.

The repository separates:

  • a portable C89 core, with no Amiga dependencies, for zones, configuration, drag state, registry and divider logic;
  • a library layer handling snapping, restoration, exclusions, options, capabilities and usable-area detection;
  • a commodity shared by the two systems for input, preview, hotkey, Exchange and preferences;
  • native ABI facades for AmigaOS 4 and MorphOS;
  • a test client, esnaptest, which uses the public API without knowing the project internals.

This is an ambitious but sensible structure. Another program could ask the library to snap a window, query the current zone, exclude a panel or move the divider without carrying a second implementation of the snapping logic.

Safety is in the details

The code also deals with problems that are typical of Amiga systems. The input handler runs in the context of input.device and cannot call Intuition directly without risking a deadlock. It therefore collects counters and signals the main task; all window operations happen outside that context.

Windows can close at any time. EdgeSnap does not treat a struct Window * as permanently valid: it references it and validates it again against the live lists under LockIBase(). The API distinguishes a vanished window, an excluded window, geometry changed by the application and an unavailable capability. Restoration after a snap also checks that the window is still where EdgeSnap placed it, so reusing an address cannot accidentally move an unrelated window.

The same care appears in ABI compatibility. AmigaOS 4 uses the ELF interface model, while MorphOS retains the classic jump table and its gates for 68k/PPC transitions. The project maintains a common public surface and explicit API generation, with queryable capabilities instead of hidden assumptions.

Current status and what comes next

The first beta release is now available on Aminet. Version 0.1 is an operational milestone, not the final word on the project: broader validation of docks and panels on real targets, stabilization of the public library contract and more documentation are still ahead. The repository describes the API as a draft, so names, values and signatures may change in future versions.

The technical history of the repository records validation on both systems: AmigaOS 4 in QEMU, and MorphOS first in QEMU and later on real hardware. The portable core passes a strict C89 host test suite, while the test client also exercises API errors, including the case of a window becoming stale.

What really changes

EdgeSnap does not invent window snapping, and it does not claim to be the answer for every AmigaOS version. Its goal is different: bring a now-natural desktop gesture to two contemporary Amiga-like systems, while keeping the architecture small enough to inspect and general enough for other programs to reuse.

The most interesting result is not the promise of having Windows on Amiga. It is how the project approaches the problem: a portable core, a library with an explicit contract, native frontends, attention to docks and tests for failure cases. With beta 0.1 now available on Aminet, EdgeSnap is ready for AmigaOS 4 and MorphOS users to try, while real-world feedback will shape the next releases.

In brief

  • EdgeSnap brings edge and corner snapping to AmigaOS 4.x and MorphOS.
  • It includes a preview, hotkey, geometry restoration, dock and panel detection, and a divider for side-by-side windows.
  • The engine is separated from the commodity and designed around edgesnap.library.
  • The C89 core is tested on the host, and behaviour has been validated in QEMU and on MorphOS hardware.
  • Beta 0.1 is available on Aminet, with development continuing on GitHub.

Sources and context

AUTHOR

IT specialist, developer and systems engineer with a long history across code, Linux servers, retrocomputers and e-learning platforms. On AndroidLab he brings a technical, pragmatic eye: less brochure smoke, more attention to infrastructure, usability, privacy, updates and the real consequences of manufacturers' choices.

Leave a Comment