Rectangle icon indicating copy to clipboard operation
Rectangle copied to clipboard

Size of windows sometimes include space for dock when dock set to automatically hide

Open RSM9 opened this issue 1 month ago • 6 comments

  • [x] This is a new bug that hasn't been documented in a closed issue or in the Readme.

The app is great. On the new 27.2 beta, I have had some issues with the drag to snap working inconsistently (it is currently not working for me), but otherwise it is fine.

The slightly annoying issue I face (which might be difficult to fix) is related to the fact I have set both the menu bar and dock to always hide automatically. When the dock hides automatically, maximising or snapping a window left/right works perfectly and fills the screen. However, if you use control option d to show the dock, rectangle does not automatically resize the window. Yet, sometimes if the dock shows momentarily when opening an app (such as if I hovered over the app to open it but did not move the cursor away from the app quickly enough), the dimensions of the maximised/snapped window include a space for the dock, until I use a shortcut again to snap/maximise the window.

Similarly, if the menu bar is set to automatically hide, but then a shortcut is used to permanently show the menu bar, only by reopening and closing the app will it shrink to below the menu bar.

macOS version: 27.2 beta Rectangle version: 2.03 (110) Logs if applicable (In Rectangle menu, hold option, "View Logging...")

RSM9 avatar Oct 17 '26 19:10 RSM9

Thanks for reporting. This might be something that Apple will iron out on their end prior to official release. @culpen90, just curious if you run on the betas at all and are interested in taking a look since you worked on the Dock handling previously (no worries if not).

rxhanson avatar Oct 18 '26 02:10 rxhanson

Thanks for asking! I’m not running the macOS beta, so I won’t be able to take this one on.

culpen90 avatar Oct 18 '26 19:10 culpen90

The drag to snap was working on the 27.1 beta, though the issue with the sizing of windows including the auto-hiding dock has been present at least since I started using it on the stable MacOS 27 (it can be recreated on the stable version if you set the dock to automatically hide - this happens occasionally when opening apps).

RSM9 avatar Oct 18 '26 21:10 RSM9

~This is now happening for me~ using macOS Goldengate 27.0.1 (26A434) on an M3 MBP.

Weird, Rectangle's check for updates found nothing, then the about dialog showed 1.100 (106) and an update panel and I've landed on 2.0.4 (111)!

Weirder: the auto-hiding dock's space is now half above and half below the window!

Weirdest: resizing the dock (still auto-hiding) has resolved the issue entirely. 🤷

jezmck avatar Oct 22 '26 10:10 jezmck

This issue continues to pop up for me.

The fix I've been using is quitting Dock in the activity monitor. Then, you can safely snap back to expected sizes.

iam-brain avatar Oct 27 '26 14:10 iam-brain

Still happens on the released macOS 27.2.1 (26B131) with Rectangle 2.0.4. I measured why the gap ends up split above and below the window.

Setup: MacBook built-in display (1728×1117 pt) with an external display above it, Dock on the built-in, auto-hide on. After the displays changed (update reboot, external display reconnected):

  1. NSScreen.visibleFrame for the built-in still reserved room for the Dock, (0, 87, 1728, 997), although the Dock was hidden (its AXList frame was off-screen, at y = 1117).
  2. Rectangle's correctedVisibleFrame (#1823) reclaims that inset, so Maximize targets the full height: 1728×1084 at y = 33.
  3. The app refuses the extra height. Setting AXSize directly, with the same size → position → size writes Rectangle uses, to 1084 or to 997 tall left a Finder window at 996 tall every time, i.e. about the stale visible frame's height.
  4. EdgeAlignmentWindowMover then centers the 996 pt window in the 1084 pt zone, so the missing space shows as two 44 pt gaps, one above and one below.

killall Dock fixed it at once: visibleFrame became (0, 0, 1728, 1084), the same AX write then took the full 1084, and Maximize filled the screen. That fits the "quit Dock" and "resize the Dock" workarounds above. The stale value lives on the Dock / AppKit side, and Rectangle can't push a window past the app's own limit.

One small thing Rectangle could do while macOS has this bug: when it reclaimed a Dock inset and the window comes back shorter than the target, align the window to the edge away from the Dock instead of centering it. The window would then sit flush under the menu bar, with the gap only where the Dock would be. Happy to send a PR if you think that's worth it.

AkiyamaKunka avatar Nov 14 '26 05:11 AkiyamaKunka