Window Wobble
KDE-style spring-physics window dragging, without injecting into dwm.exe
Author: HeyJeay
KDE-style spring-physics window dragging. Grab a title bar and the window
follows your cursor like jelly - the title bar keeps up, the body trails
behind, and it settles with a wobble when you let go.

Hold Shift (configurable) while grabbing to move a window normally.
Licensed GPL-3.0-or-later: you are free to use, study, modify and share it,
and any version you distribute must stay open under the same terms.
How this differs from the Wobbly Windows mod
Wobbly Windows does the same
effect from inside dwm.exe, using private uDWM symbols. That is the better
place to do it: the content stays live, and it can wobble on snapping and
resizing too, not just dragging.
This mod does not touch dwm.exe. It runs in the application's own
process and draws the effect on its own Direct3D overlay. Pick whichever
trade you prefer:
Reasons to use this one
- No changes to Windhawk's process inclusion list - it works once enabled
- Nothing is injected into the compositor, so a fault here cannot take the
desktop down with it; at worst one application is affected
- No dependency on private, undocumented DWM symbols, so a Windows update
changing uDWM internals cannot break it
Reasons to use the other one
- Window content stays live; here it is a snapshot, so a playing video
appears frozen for the length of the drag
- It wobbles on snap and resize as well as drag
- One copy in the compositor, rather than a small overlay per application
Questions, problems or ideas? Join the Discord
(https://discord.gg/8wwfPxfMWA) or open an issue
(https://github.com/heyjeay/window-wobble/issues).
How it works
In plain terms
- You press on a title bar, and the mod quietly takes a photograph of the
whole window.
- The real window is made invisible. Not minimised, not moved - just not
drawn. Its taskbar button stays exactly where it was.
- The photograph is pinned to an invisible grid, like a sheet of rubber, and
shown in the window's place. The top edge of the sheet is stiff and keeps
up with your cursor; further down it gets floppier. That is the whole
trick - the body lags behind the title bar because the bottom of the sheet
is softer than the top.
- All the while you are dragging, the mod is just moving that rubber sheet
around and letting the springs do what springs do.
- When you let go, the real window is moved to where you dropped it while it
is still invisible, then made visible again underneath the photograph.
Only once it is safely back does the photograph disappear, so you never
catch the swap happening.
Two things follow from this, and they are the reason for the bypass key. The
window content is a photograph for as long as you hold it, so a playing video
looks frozen. And because the mod is doing the dragging instead of Windows,
Windows' own dragging features do not happen - see the section above.
Under the hood
A title-bar press is caught at DispatchMessage, with DefWindowProc as a
backup and WM_SYSCOMMAND/SC_MOVE alongside for apps that draw their own
title bars. The mod then runs its own move loop in place of the one Windows
would start: the window is captured with PrintWindow(PW_RENDERFULLCONTENT),
cloaked so it leaves composition entirely, and a spring mesh of that capture
is drawn on a Direct3D 11 + DirectComposition overlay until you let go.
The mesh is two layers of springs: a control spring pulling each vertex back
to its rest position, with the stiffness falling off down the rows, and
springs between neighbouring vertices so the grid holds together instead of
turning to taffy. On release the control springs are switched to a stiff,
overdamped pair so it snaps back rather than ringing.
The drag runs on one persistent worker thread per process, never in the
message pump: PrintWindow(PW_RENDERFULLCONTENT) renders through DWM and
needs the window's own thread pumping, so doing it inline deadlocks against
the very loop that invoked it.
Only top-level windows are touched, and only ones DWM will cloak. Anything
else is handed back to Windows, which then runs its own move loop as usual.
What you give up during a wobble drag
The mod replaces Windows' move loop, so for the windows it animates these do
not happen:
- Aero Snap (dragging to a screen edge or the top)
- the Snap Layouts bar at the top of the screen
- restoring a snapped window's previous size when you drag it out
- shake to minimize
WM_ENTERSIZEMOVE / WM_MOVING / WM_EXITSIZEMOVE, which docking UIs
such as Visual Studio's tool windows use to show drop targets
Hold the bypass key (Shift by default) while grabbing to get all of that
back for a drag.
Excluded processes
Shell and UI-host processes are excluded, since none of them own a window you
would drag: sihost.exe, RuntimeBroker.exe, StartMenuExperienceHost.exe,
ShellExperienceHost.exe, SearchHost.exe, TextInputHost.exe,
ApplicationFrameHost.exe and NVDisplay.Container.exe.
Windhawk never injects into the critical system processes (csrss.exe,
dwm.exe, lsass.exe and the rest), so those need no entry here.
Notes
Window content is a snapshot for the duration of the drag, so a playing video
appears frozen while you hold it. This is inherent to the approach - capturing
live content per frame is far more expensive than one PrintWindow.
The Direct3D device and the overlay are released after a few seconds without
a drag, so an application you dragged once does not hold them for the rest of
its life. They are rebuilt on the next drag, which costs a few milliseconds.