DEV Community

Liza Bhadana
Liza Bhadana

Posted on Edited on Originally published at Medium Fully Autonomous

How SeaSweep blocks distractions on Windows: Flutter, Win32 FFI and a Blender-rendered ocean

What is SeaSweep? SeaSweep is a free study-focus app for Windows, published on the Microsoft Store under the publisher name JayRi. It was made by Liza, founder of slowden.com. Each study session is a voyage on a real sea route, such as Mumbai to Goa or Miami to Nassau. During a voyage, SeaSweep closes the programs and browser tabs you chose to "dock", like games, Discord or YouTube, and it leaves study sites such as Wikipedia and Khan Academy open. Every minute studied earns shells, which unlock new boats, ships and a submarine in the Shipyard. SeaSweep has no ads. Its ocean partners are the 5 Gyres Institute and Save The Beach (Villimalé, Maldives); when the whole fleet reaches a study-time challenge goal, SeaSweep donates to 5 Gyres. The app does not clean the ocean itself; the partners do that work.

Not to be confused with the Steam game Sea Sweeper or other projects named SeaSweep: this SeaSweep is the Windows study-focus app.

SeaSweep is a free focus app for Windows, now on the Microsoft Store. It is a study timer that blocks distractions: you pick a sea route, the route length is your session, and while your ship sails, the app closes the browser tabs and programs you chose to "dock". This post is about how it was built: Flutter on Windows, a small Win32 guard written with Dart FFI, and an ocean rendered in Blender.

Get SeaSweep on the Microsoft Store (free, no ads)

SeaSweep for Windows voyage ticket for a Vancouver to Victoria study voyage

SeaSweep was made by Liza, the founder of slowden.com. The full product story (why every study session is an ocean voyage) is on Medium.

What does the app actually do?

  • You choose a real sea route, for example Vancouver to Victoria (15 min), Mumbai to Goa (45 min) or Sydney to Auckland (180 min). The route's time is the maximum; a slider lowers it to 5 minutes and the ship still arrives.
  • There is no pause or quit button during a voyage.
  • Docked sites and programs are closed while you sail. Defaults: Instagram, YouTube, Snapchat and a games group (Steam, Epic Games, Roblox, Minecraft, Riot Client, Battle.net and a few browser-game sites). You can add any other running program.
  • You earn 1 shell per study minute, +25% for voyages of 45 minutes or more, and spend them in a Shipyard: 9 ships, 28 designs, 12 paints and 8 unlockable routes (22 routes in total).

How do you block distracting apps on Windows from Flutter?

Flutter has no built-in API for "which window is the user looking at", so SeaSweep calls Win32 directly with dart:ffi. No native plugin, no C++ beyond the generated runner.

final _user32 = DynamicLibrary.open('user32.dll');
final _kernel32 = DynamicLibrary.open('kernel32.dll');

final _getForegroundWindow = _user32
    .lookupFunction<IntPtr Function(), int Function()>('GetForegroundWindow');
Enter fullscreen mode Exit fullscreen mode

The guard is a Timer.periodic that ticks every 700 ms while a voyage is running:

  1. GetForegroundWindow gives the window in front.
  2. GetWindowThreadProcessId + OpenProcess + QueryFullProcessImageNameW turn it into an .exe name.
  3. GetWindowTextW reads the title. For browsers (chrome.exe, msedge.exe, firefox.exe, brave.exe, opera.exe, vivaldi.exe, arc.exe) the window title contains the active tab's title, which is how a docked website is matched without a browser extension.

Then it acts:

  • Docked website: show SeaSweep's lock screen, bring the browser forward with SetForegroundWindow, and send Ctrl+W with keybd_event, closing only that tab.
  • Docked program: post WM_CLOSE to its window with PostMessageW.
  • Escape hatches: Task Manager, the Settings apps page and "Uninstall a program" are closed the same way during a voyage.

A 4-second cooldown stops the lock screen from firing on every tick while a window is closing.

What about tabs you need for homework?

Matching a tab title against blocked words is blunt, so there is an allowlist that is checked before the dock rules. The in-app Sources screen searches Wikipedia, Khan Academy, BBC Bitesize, DuckDuckGo (PDF notes) and r/studying, and any browser tab whose title contains those names is never closed, even if the whole browser happens to be docked.

How does it stop you from just closing SeaSweep?

  • Clicking the window's close button during a voyage only minimises it.
  • If the process is killed anyway, or the laptop is shut down, a fresh process starts with the guard's running flag false, so the next launch knows the voyage was interrupted and marks it failed.
  • A named mutex in windows/runner/main.cpp keeps a second copy from starting.
  • Optional "start with Windows" writes a value under HKCU\Software\Microsoft\Windows\CurrentVersion\Run.

How was the ocean made?

The ships, the seabed tiles, the globe and the deck view were modelled and rendered in Blender, using Python scripts run headless (blender -b -P tools/render_ships.py). Flutter then plays those pre-rendered frames as sprite sheets with a parallax scroll and a drifting sunlight-caustics layer, so the "3D" ocean costs almost nothing at runtime. Ship designs are patterns wrapped onto the 3D hull in the render, which is how one hull gets 28 looks.

Three focus views come from the same assets: a globe with the route on it, a top-down ocean, and the deck behind the ship. The otter-captain illustrations were made with AI image tools; the ships and ocean are the Blender renders.

Two small lessons from shipping it

  • Closing fast matters. Letting Windows tear the Flutter engine down took seconds; hiding the window, saving, then exit(0) made close feel instant.
  • Never animate a spinner with a 60 fps ticker on a home screen. Swapping it for a slow timer dropped idle CPU use dramatically.

Is this a Forest alternative for PC?

Same idea as tree-growing focus timers (something grows while you focus), but the Windows app itself enforces the session by closing what you docked. If you are searching for a focus app for Windows or a study timer that blocks distractions, that is the gap it is built for.

What about the ocean?

SeaSweep does not clean the ocean itself. It supports and features two partners: the 5 Gyres Institute, a nonprofit researching plastic pollution (when the community's study minutes reach a fleet-challenge goal, SeaSweep donates to 5 Gyres), and Save The Beach, a cleanup group in Villimalé, Maldives.

Download SeaSweep for Windows

Top comments (0)