I built a desktop snow overlay where the snow actually piles up on your open windows
Every December I want my desktop to feel a bit like a cabin window. The old desktop-snow toys just drift flakes over everything, so this year I built CozySnow: snow that falls, lands on the tops of your real windows, and stays there until you move the window or brush it off.
How it works (Windows build)
A click-through overlay
The overlay is a frameless, always-on-top PyQt6 window covering the screen. With the Win32 extended styles WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_NOACTIVATE | WS_EX_TOOLWINDOW it never steals focus or clicks, and it stays out of Alt-Tab.
A 16 ms timer drives the simulation at about 60 fps.
Finding the "ledges"
Every tick a window tracker walks the visible top-level windows with EnumWindows, takes their real bounds from DWM (the extended frame bounds, not the padded GetWindowRect), and skips cloaked windows (other virtual desktops, suspended UWP apps).
The tricky part is overlap: if one window covers half of another's title bar, snow should only pile on the visible part. So each window's top edge is an interval, and the tracker subtracts every window above it in z-order, leaving only the exposed segments as ledges.
The taskbar top is the floor.
Snow piles that follow windows
Each ledge gets a height map in small bins. Flakes that hit a ledge add to it and the pile rides along when you drag the window. Shake the window and the pile bursts off in clumps and the icicles underneath shatter; fling it fast and chunks shed off the edge.
Icicles hang from the edges, and a little yellow snowplow clears the floor now and then.
Staying polite
It checks for a fullscreen game or video and pauses rendering, so it costs nothing while you play.
Global hotkeys spawn a snowman or throw a snowball at the screen.
Extras
A frost mode that fogs the whole screen like cabin glass (wipe it with the cursor), snowmen, gift drops, and Santa's sleigh crossing the moon.
There is also a macOS build.
If you want to try it, it is $5.99 one-time at https://cozysnow.app. I'm happy to answer questions about the window-occlusion math or the Win32 overlay tricks in the comments.
Comments
No comments yet. Start the discussion.