Releases: junegu-glitch/RectangleWin
Releases · junegu-glitch/RectangleWin
v0.3.0 - Opacity, center-keep-size, pull-to-cursor
Added
Ctrl+Win+O— Cycle window opacity: 100% → 80% → 60% → 100%. Useful for keeping an auxiliary window visible without occluding the main work area (video PIP, reference docs over a game, etc.).Ctrl+Win+G— Center the active window on its current monitor without resizing. Distinct fromCtrl+Win+C(Smart Center), which resizes to a 1/3 strip.Ctrl+Win+P— Pull the active window to the monitor under the mouse cursor. Snap state is preserved (e.g. a "right half" window stays "right half" on the target monitor). Useful when you want a window where your attention already is, without thinking about direction keys.
Fixed
MouseGetPosis now explicitly set to screen coordinates (CoordMode("Mouse", "Screen")). AHK v2's default is client-relative, which madeCtrl+Win+Pfail when the cursor was on a different monitor than the active window.
Internal
OpacityStatemap joinsUndoMapandSnapStatein the 60-second periodic cleanup.SnapStatenow supports a"Gravity"kind so thatCtrl+Win+G's "centered, size-preserved" intent survives a subsequentCtrl+Win+Shift+Arrowmonitor jump.
v0.2.0 - One-line installer
Added
- One-line installer (
install.ps1). Users can now install RectangleWin with a single PowerShell command — it auto-installs AutoHotkey v2 (via winget) if missing, downloads the latest script, registers it in the Startup folder, and launches it. No admin required. - One-line uninstaller (
uninstall.ps1) — stops the running script, removes the autostart shortcut, and clears the install folder. - README rewritten to lead with the one-liner; manual install is now the "if you'd rather do it yourself" path.
Notes
- Functionality is unchanged from v0.1.7. v0.2.0 is purely a packaging / install-UX release.
- A standalone
.exebuild was considered but deferred: Windows Defender flags AutoHotkey's Ahk2Exe compiler as a potential threat (a common false positive for script-compilation tools), so reliably producing one without a code-signing cert is impractical right now. The PowerShell one-liner provides the same "frictionless install" goal without that friction.
v0.1.7 - Cross-DPI cross-monitor fix
Fixed
- Cross-DPI monitor jumps now preserve window size correctly. Previously, moving a window between monitors with different DPI scaling (e.g. 100% ↔ 150%) caused the size to be distorted by the DPI ratio (a "top half" snap became "top 2/3" going 100%→150%). The fix: after the initial
WinMove(which triggersWM_DPICHANGEDon the target app and may cause auto-rescaling), wait 50ms for the message loop to settle and then enforce the exact rectangle via rawSetWindowPoswithSWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE. Bypasses both AHK's coordinate wrapper and the target window proc's chance to override our size. - Same-monitor snaps and same-DPI cross-monitor jumps are unchanged from v0.1.6 (no behavior regression). The two previous DPI fix attempts (v0.1.4 / v0.1.5) regressed because they tampered with the hotkey thread's DPI awareness context, which conflicted with AHK's internal coordinate handling. v0.1.7 leaves thread DPI alone and only intervenes after the move on cross-monitor jumps.
SWP_NOCOPYBITSalso eliminates the brief visual stretching of old-DPI pixels during the transition.
Credits
- Hypothesis pre-review and final patch validation by Gemini.
v0.1.6 - Rollback DPI fixes, restore stable Snap
Reverted
- The
SetThreadDpiAwarenessContext(-4)calls and the two-stepWinMoveblock added in v0.1.4 / v0.1.5. They were intended to fix cross-DPI monitor jumps but instead caused worse regressions on real hardware (windows landing outside the target monitor; same-monitor up/down snaps bouncing the window around). TheSnap()primitive is back to the v0.1.3 form:SaveUndo→ optionallyWinRestore→ oneWinMove. AHK's process manifest is already per-monitor-aware V2; explicit per-thread tampering was doing more harm than good.
Kept (from v0.1.5)
- Cleaner
GetMonitorAt(cx, cy)helper separated fromGetMonitorOf(hwnd). FindAdjacentMonitorwith 2× orthogonal-axis penalty for L-shape and asymmetric multi-monitor setups.- Periodic
CleanUpStateMapstimer (every 60s) to drop entries for closed windows fromUndoMap/SnapState. - The full v0.1.3 logical-snap-state architecture (
SnapStatemap +ApplySnapState) so snap state is preserved across same-DPI monitor jumps.
Known limitations
- Cross-monitor jumps between displays with different DPI scaling may distort window size by the DPI ratio. Same-monitor snaps and same-DPI cross-monitor jumps work correctly. A proper fix using raw
SetWindowPosis planned.
v0.1.5 - Fix same-monitor bounce + L-shape adjacency
Fixed
- Same-monitor snaps no longer bounce windows to a different monitor. v0.1.4's two-step move used the old window size at the new position for step 1. If the window was large (e.g. recently dragged from a 4K monitor), placing it at a new position on the FHD monitor caused the window rectangle to span both monitors, with the majority of the area on the wrong monitor. Windows'
MonitorFromRectthen reassigned the window to that monitor, triggering a spuriousWM_DPICHANGEDand the app jumped. New logic: the two-step move is only used when source and target monitors actually differ, and both steps use the final(x, y, w, h)— never the current size. - L-shape multi-monitor setups now navigate correctly.
FindAdjacentMonitorpreviously compared monitor center coordinates on a single axis, which could pick a far-away diagonal monitor as the "U/D/L/R" target. Now displacement in the orthogonal axis is penalized 2×, so monitors that are spatially aligned with the current one are preferred.
Changed
- Per-hwnd state Maps (
UndoMap,SnapState) are now garbage-collected every 60 seconds to drop entries for closed windows.
Credits
- Diagnosis and patches reviewed by Gemini.
v0.1.4 - General cross-monitor DPI fix
Fixed
- Cross-monitor jumps now work across any DPI / orientation / monitor-count combination. v0.1.3 introduced the correct architectural fix (re-apply the logical snap on the target monitor's work area instead of mapping ratios), but the low-level
WinMovecall was still being silently overridden by Windows' automaticWM_DPICHANGEDrescale whenever the source and target monitors had different DPI scaling. The result was that a top-half window on a 100% monitor became a top-2/3 window after jumping to a 150% monitor (exactly the DPI ratio). This release fixes the underlyingSnapprimitive:- Forces per-monitor-aware V2 thread context (
SetThreadDpiAwarenessContext(-4)) around every move/resize so all coordinates are interpreted as physical pixels. - Uses a two-step move when crossing monitors: first move the window with its current size so it crosses the DPI boundary, then resize on the target monitor's DPI context. The OS no longer gets a chance to scale our requested width/height.
- Forces per-monitor-aware V2 thread context (
- The fix is general: it doesn't assume a specific DPI ratio, monitor count, or orientation. Single-monitor users see no change (the second
WinMoveis a no-op when the position is unchanged from the source).
Added (internal, off by default)
- Diagnostic logging via
DebugLog := trueflag at the top of the script. When enabled, every snap and monitor jump is recorded to%LOCALAPPDATA%\RectangleWin\debug.logwith hwnd, monitor index, work area, and window rect. Off in releases; useful for troubleshooting reports.
v0.1.3 - Snap state preserved across monitors
Fixed
- Snap state is now preserved across monitor jumps. Previously, moving a window between monitors used a ratio-based mapping (window position/size as a fraction of the source work area, re-applied on the target). On setups with different DPI scales (e.g. portrait FHD ↔ landscape 4K), DWM invisible borders, or taskbar differences, this produced visible drift — a top-half window would become top 2/3, and repeated jumps compounded the error.
- The new behavior records the logical snap (e.g.
top half,left 1/3,bottom-right quarter) when a snap shortcut is pressed, and re-applies that same logical snap on the target monitor's work area. Result: top-half stays top-half regardless of DPI or aspect ratio differences, with no compounding drift across repeated jumps. - If a window has no recorded snap state (e.g. user dragged it manually), the monitor-jump now keeps its size and places it at the target monitor's center instead of trying to scale it.
v0.1.2 - 4-direction monitor jump
Added
Ctrl+Win+Shift+Up/Ctrl+Win+Shift+Down— move window to the monitor above / below the current one. Useful for vertically-stacked monitor setups (laptop + external display on top, etc.).
Changed
- Monitor-jump shortcuts are now described as directional ("the monitor on the left/right/above/below"), not "previous/next". Behavior of the existing left/right shortcuts is unchanged — it was already position-based.
v0.1.1 - Smart center key
Changed
Ctrl+Win+Cis now orientation-aware: on a landscape monitor it snaps to the center column 1/3 (previous behavior); on a portrait monitor it snaps to the middle row 1/3. One key, the right thing on either monitor.
Added
Ctrl+Win+H— force center column 1/3 regardless of monitor orientation (for landscape-style 3-column layouts on a portrait monitor).
Notes
Ctrl+Win+Vis unchanged — still forces the middle row 1/3 (for portrait-style 3-row layouts on a landscape monitor).
v0.1.0 - Initial release
Changelog
v0.1.0 — 2026-05-12
Initial release.
Features
- Fullscreen snap (
Ctrl+Win+Enter) - Edge cycle: half → third → two-thirds (
Ctrl+Win+←/→/↑/↓) - Center column 1/3 (
Ctrl+Win+C) — for 3-column layouts - Middle row 1/3 (
Ctrl+Win+V) — for 3-row layouts - Quarter corners on numpad (
Ctrl+Win+Numpad 7/9/1/3) - Move window to adjacent monitor, preserving size ratio (
Ctrl+Win+Shift+←/→) - Undo last snap (
Ctrl+Win+Z) - Toggle Always-on-Top (
Ctrl+Win+T) - Tray icon with shortcut cheat sheet