<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Charles Samontanez</title>
    <description>The latest articles on DEV Community by Charles Samontanez (@chals1029).</description>
    <link>https://dev.to/chals1029</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4284463%2F97de37a0-5ca2-4e53-b201-2b3a7af85309.png</url>
      <title>DEV Community: Charles Samontanez</title>
      <link>https://dev.to/chals1029</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chals1029"/>
    <language>en</language>
    <item>
      <title>I Built a ~2.5 MB macOS-Style Dock &amp; Dynamic Island for Windows in Pure Rust (No Electron)</title>
      <dc:creator>Charles Samontanez</dc:creator>
      <pubDate>Sat, 05 Dec 2026 10:35:18 +0000</pubDate>
      <link>https://dev.to/chals1029/i-built-a-25-mb-macos-style-dock-dynamic-island-for-windows-in-pure-rust-no-electron-1l2k</link>
      <guid>https://dev.to/chals1029/i-built-a-25-mb-macos-style-dock-dynamic-island-for-windows-in-pure-rust-no-electron-1l2k</guid>
      <description>&lt;p&gt;Most macOS-style docks for Windows share the same problem: they wrap a browser engine (Electron or WebView2) and burn 150–300+ MB of RAM just to sit idle at the bottom of your screen.&lt;/p&gt;

&lt;p&gt;I wanted a Windows 10/11 dock and morphing &lt;strong&gt;Dynamic Island&lt;/strong&gt; that felt genuinely native, started instantly, and stayed completely out of the way when gaming or working. So I built &lt;strong&gt;ChalzDock&lt;/strong&gt; in &lt;strong&gt;pure Rust&lt;/strong&gt; — no Electron, no Chromium, no WebView2, and no .NET runtime.&lt;/p&gt;

&lt;p&gt;Today it ships as a single &lt;strong&gt;&lt;code&gt;~2.55 MB&lt;/code&gt; standalone &lt;code&gt;.exe&lt;/code&gt;&lt;/strong&gt; under &lt;strong&gt;GPL-3.0&lt;/strong&gt;. Here is how I designed it and the Win32/Direct2D tricks that keep it fast.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Stack
&lt;/h2&gt;

&lt;p&gt;Instead of reaching for a web UI framework, ChalzDock renders directly through Windows graphics APIs in Rust:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Win32&lt;/strong&gt; for window management, global hotkeys, shell hooks, and app enumeration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Direct2D &amp;amp; DirectWrite&lt;/strong&gt; for crisp vector glass UI, icons, and typography&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DirectComposition&lt;/strong&gt; (&lt;code&gt;WS_EX_NOREDIRECTIONBITMAP&lt;/code&gt;) for hardware-accelerated per-pixel alpha transparency&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Single-binary release&lt;/strong&gt; built reproducibly via GitHub Actions (&lt;code&gt;windows-latest&lt;/code&gt;) with SHA-256 checksums&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5 Architecture Decisions That Kept It Light
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Adaptive Frame Pacing (&lt;code&gt;DwmFlush&lt;/code&gt; -&amp;gt; &lt;code&gt;55ms&lt;/code&gt; -&amp;gt; &lt;code&gt;100ms&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Running a constant 120 FPS render loop for a desktop shell wastes battery and GPU clocks. ChalzDock dynamically shifts its pacing loop:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;60/120 Hz &lt;code&gt;DwmFlush&lt;/code&gt; VSync&lt;/strong&gt; only while icon magnification springs, popup entrances, or drags are actively animating&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;55ms&lt;/code&gt; (~18 FPS)&lt;/strong&gt; when a live audio visualizer is active in the Dynamic Island&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;100ms&lt;/code&gt; &lt;code&gt;MsgWaitForMultipleObjects&lt;/code&gt;&lt;/strong&gt; deep idle sleep when the UI is static&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. 10-Second &lt;code&gt;LazyPopup&lt;/code&gt; GPU Surface Reaping
&lt;/h3&gt;

&lt;p&gt;ChalzDock has a lot of popups — Start Menu, Spotlight search, Bento Control Center, System Monitor &amp;amp; Storage Cleaner, 4-Column System Tray, Calendar &amp;amp; Focus Notes, Modern Run (&lt;code&gt;Win+R&lt;/code&gt;), and Settings.&lt;/p&gt;

&lt;p&gt;Keeping GPU swapchains alive for all of them permanently would bloat memory. Instead, each &lt;code&gt;LazyPopup&lt;/code&gt; allocates its DirectComposition surface on first open and &lt;strong&gt;automatically releases it 10 seconds after closing&lt;/strong&gt;. On a local Windows 11 sample (&lt;code&gt;PrivateMemorySize64&lt;/code&gt;), that keeps cold idle around &lt;strong&gt;~36 MB&lt;/strong&gt; and active popups around &lt;strong&gt;~52 MB&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Single-EXE Self-Hosted &lt;code&gt;--watchdog&lt;/code&gt; for Taskbar Safety
&lt;/h3&gt;

&lt;p&gt;One of the scariest things about custom Windows docks is hiding the native taskbar (&lt;code&gt;Shell_TrayWnd&lt;/code&gt;): if the dock crashes or gets force-killed, you can end up stranded without a taskbar.&lt;/p&gt;

&lt;p&gt;ChalzDock solves this without a separate helper binary. On launch, &lt;code&gt;ChalzDock.exe&lt;/code&gt; spawns a second copy of itself with &lt;code&gt;--watchdog&lt;/code&gt; (branching early before UI initialization):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uses &lt;strong&gt;~1.8 MB&lt;/strong&gt; private memory&lt;/li&gt;
&lt;li&gt;Blocks in a kernel &lt;code&gt;WaitForSingleObject(..., INFINITE)&lt;/code&gt; call (zero CPU usage)&lt;/li&gt;
&lt;li&gt;If the main process crashes or exits unexpectedly, the watchdog immediately restores the native Windows taskbar state and exits cleanly&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Zero-Allocation Smoked Obsidian &amp;amp; Liquid Glass Themes
&lt;/h3&gt;

&lt;p&gt;In &lt;code&gt;v0.1.5-beta&lt;/code&gt; and &lt;code&gt;v0.1.6-beta&lt;/code&gt;, I added a dedicated &lt;strong&gt;Themes&lt;/strong&gt; tab with &lt;strong&gt;Smoked Obsidian&lt;/strong&gt; and &lt;strong&gt;Liquid Glass&lt;/strong&gt; presets plus live Glass Tuning.&lt;/p&gt;

&lt;p&gt;To avoid per-frame allocations in Direct2D, refractive linear gradient brushes (&lt;code&gt;lg_panel_fill&lt;/code&gt;, &lt;code&gt;lg_capsule_fill&lt;/code&gt;, &lt;code&gt;lg_rim_stroke&lt;/code&gt;) are pre-allocated once and synchronized across all popup surfaces whenever you adjust tint or switch themes.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Non-Blocking Background Workers &amp;amp; Fullscreen Game Guard
&lt;/h3&gt;

&lt;p&gt;Nothing heavy runs on the UI thread:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Media (GSMTC):&lt;/strong&gt; Polls active playback across Spotify, Apple Music, and browsers with active-playing priority&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Audio (WASAPI):&lt;/strong&gt; Per-app volume controls and output device switching&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;App Discovery (&lt;code&gt;v0.1.7-beta&lt;/code&gt;):&lt;/strong&gt; Enumerates both classic Win32 shortcuts and &lt;code&gt;FOLDERID_AppsFolder&lt;/code&gt; so Microsoft Store &amp;amp; MSIX apps appear natively in Start Menu and Spotlight&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Game-Mode Guard:&lt;/strong&gt; Detects true fullscreen apps/games and suppresses non-critical animations and Dynamic Island popups so your frame pacing stays untouched&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  High-Level Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ChalzDock.exe
 ├── --watchdog mode     -&amp;gt; Early branch · WaitForSingleObject(INFINITE) · Restores Shell_TrayWnd on crash
 └── Main UI thread
      ├── Win32 Event Loop  (Adaptive DwmFlush VSync / 100ms idle MsgWait)
      ├── DirectComposition (Dock Bar, Morphing Dynamic Island, 10s LazyPopups)
      ├── Physics Springs   (Cosine-falloff magnification + spring convergence)
      └── Background Workers
           ├── Media (GSMTC active session priority)
           ├── Audio (WASAPI per-app volume + endpoints)
           ├── Shelf (Clipboard + OLE drag/drop staging)
           ├── System Monitor &amp;amp; Safe Storage Cleaner
           └── Windows Toast Notification Listener -&amp;gt; Dynamic Island
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What Shipping 7 Beta Releases Taught Me
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Always build crash recovery first when touching the Windows shell.&lt;/strong&gt; A tiny kernel-wait watchdog turns taskbar replacement from terrifying into rock-solid.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real hardware tests beat assumptions.&lt;/strong&gt; LCD brightness needed native IOCTL calls with WMI fallback, and Wi-Fi auth needed temporary &lt;code&gt;WlanConnect&lt;/code&gt; profiles with volatile memory wiping of credential buffers afterward.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Self-updating matters for solo desktop apps.&lt;/strong&gt; Adding a one-click in-place updater (&lt;code&gt;v0.1.3-beta&lt;/code&gt;) with SHA-256 verification, automatic restart, and rollback made shipping &lt;code&gt;v0.1.4&lt;/code&gt; through &lt;code&gt;v0.1.7&lt;/code&gt; painless for testers.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Try It Out
&lt;/h2&gt;

&lt;p&gt;ChalzDock is completely &lt;strong&gt;free, open-source (&lt;code&gt;GPL-3.0&lt;/code&gt;), and local-first&lt;/strong&gt; (zero telemetry or analytics):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Website &amp;amp; Download:&lt;/strong&gt; &lt;a href="https://chalzdock.vercel.app" rel="noopener noreferrer"&gt;chalzdock.vercel.app&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/chals1029/ChalzDock" rel="noopener noreferrer"&gt;github.com/chals1029/ChalzDock&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Latest Release (&lt;code&gt;v0.1.7-beta&lt;/code&gt;):&lt;/strong&gt; &lt;a href="https://github.com/chals1029/ChalzDock/releases" rel="noopener noreferrer"&gt;GitHub Releases&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have built native Windows shells with Rust, Direct2D, or DirectComposition — or if you try ChalzDock and find rough edges — I would love to hear your feedback in the comments!&lt;/p&gt;

</description>
      <category>rust</category>
      <category>windows</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
