Rectangle icon indicating copy to clipboard operation
Rectangle copied to clipboard

“Maximize” sometimes (but not always) fails to notice the Dock

Open tjluoma opened this issue 4 years ago • 10 comments

The frustrating this about this is that I cannot repeat it reliably, but it has been happening enough for me to notice it, and for long enough that I finally decided to report it.

—-

macOS version: macOS version 11.4 (20F5065a) — this is the latest public beta of Mac OS 11, and I suppose it’s possible that this is beta-related.

Rectangle version:

/Applications/Rectangle.app: CFBundleShortVersionString: 0.46 CFBundleVersion: 51

—-

I have a keyboard shortcut for Maximize that I use all of the time. What I have noticed happening “recently” (although I’m not sure exactly when) is that the window will be maximized and end up partially behind the dock (which is unhidden on the left side of the screen).

I know there has been at least 1 release of Rectangle since I first noticed this happening because I remember thinking “Oh, I wonder if this will fix the ‘maximize’ problem I’ve been having” but it did not.

When it happens, pressing the keyboard shortcut for Maximize will always fix it. And when I try to make it happen intentionally, I never can, so I can’t seem to figure out what might be the common situation that triggers this behavior.

I also do toggle the Dock’s “auto-hide” setting on/off regularly, but I am fairly certain that what I am seeing is not just the result of the dock being unhidden when an app window was already ‘Maximized’.

tjluoma avatar May 15 '21 16:05 tjluoma

I just noticed that when I resized a window to 'Bottom Half' of the screen, the window went behind the dock, which was already open.

Repeating the keyboard command fixed it.

tjluoma avatar May 15 '21 16:05 tjluoma

Thanks for taking the time to report what you've found.

It is actually a macOS bug that has been around for quite some time. It's in a couple other issues but maybe manifested in slightly different ways, and was reported in Spectacle years ago. Typically it's seen when external displays are connected.

Rectangle basically does not have any awareness of Dock visibility and Dock size. It just gets the visible dimensions of the screen from macOS, which takes into account the Dock (except for when this bug occurs). As such, there's not really a good solution from within Rectangle. I could get Rectangle to poll the visible screen for changes to tell when the dock changes, but that still would end up with some stuttery window movement when the visible screen finally gets corrected, at which point it's probably better to just have a user hit the keyboard shortcut again.

If you can come up with a more repeatable way to reproduce it, let me know and I'll see if there's anything better I can come up with to work around it.

rxhanson avatar May 15 '21 22:05 rxhanson

@rxhanson I think I have a way to reproduce problems with dock (macOS 12.0.1).

  • Enable dock auto hiding
  • When the dock is hidden, maximize an app window
  • Turn dock auto hiding off
  • Try to maximize window once again

The window will be moved left instead of changing its size. But the second "Maximize" call will be successful. Also, I see similar behavior when disconnecting an external monitor. Windows that were maximized on a bigger monitor sometimes cannot be properly resized for Macbook built-in monitor on the first attempt.

https://user-images.githubusercontent.com/5401536/145164757-f204ebd1-0431-47f5-80a1-deb9e3556543.mov

Bringoff avatar Dec 08 '21 07:12 Bringoff

Possible cause for me: Because this is what I found while searching, for me it was moving the dock around to different monitors that seemed to cause it by holding the mouse in the right position...

workaround: Anyway alternated which display was the main display and I guess Mac reported the correct position again.

stealthgyro avatar Mar 31 '22 19:03 stealthgyro

Possible cause for me: Because this is what I found while searching, for me it was moving the dock around to different monitors that seemed to cause it by holding the mouse in the right position...

workaround: Anyway alternated which display was the main display and I guess Mac reported the correct position again.

Thank you for sharing - this actually worked for me "alternated which display was the main display"

chetannagarkar avatar Sep 08 '22 23:09 chetannagarkar

Maybe this could help some: microsoft answers

BaurTokenov avatar Nov 28 '22 11:11 BaurTokenov

I've the same issue randomly and hitting again the Maximize button (either through the shortcut or from the UI) doesn't work for me.

What it does work as I just discovered while reading this issue is enabling and disabling the "Automatically hide and show the dock" in Mac preferences.

nahueloyha avatar Feb 24 '23 16:02 nahueloyha

+1 for this issue. I already had "Automatically hide and show the dock" disabled, but the issue pops up when an external display is plugged in, after which the Dock can be on either screen. Rectangle fails to detect the presence of the Dock. Spectacle version 0.75 on Macbook Pro 13" M1, with an iPad Pro 11" attached as external display.

ntn-x2 avatar Feb 15 '24 11:02 ntn-x2

+1 for me on this as well. Rectangle 0.76 (82)

mitchplze avatar Mar 29 '24 02:03 mitchplze

This issue is on the macOS side, unfortunately, and I am not aware of a good workaround. A pull request is welcome if anyone finds a workaround.

rxhanson avatar Mar 29 '24 05:03 rxhanson