I have recently upgraded from 2020 LTS to 2021.2.17f1.
I have some custom EditorWindows which I like to keep docked. Now in 2021 the minSize seems to be ignored IF they are docked. If the windows is free floating it adheres to the set minSize.
Here you can see it in action:
First I have the window floating and it’s very small (as I want it).
As soon as I dock it it can not be resized to a smaller vertical size (it pushes the other window down).
The code used is very simple:
[MenuItem("Window/BreakOnClick")]
static void Init()
{
// Get existing open window or if none, make a new one:
var window = (BreakOnClick)EditorWindow.GetWindow(typeof(BreakOnClick));
window.minSize = new Vector2(22, 22);
window.Show();
}
I tried to remove all code in OnGUI() just to make sure there is not “layouting” stuff breaking anything. But still, the result is the same.
Sniff around the window API (or is it EditorWindow I guess??) because maybe they changed it to have another property, like “safe size” or something else that must also be set nowadays… Just random thoughts to try.
Haha, yes, maybe I’ll have to unwrap my reflections club to hit Unity with it . Yes, it’s an EditorWindow. I have found some older posts about docked editor windows not adhering to maxSize. So maybe this is an old issue which now also affects minSize in 2021. It’s not a high priority thing for me though. Just a little annoying.
Thanks.
Hi!
Have you found a solution to this issue, by chance? I have the same problem, and it’s quite annoying.
It seems to not be a bug, but is as design, as the documentation of EditorWindow.minSize has been updated and now say “The minimum size is not used when the window is docked.”
But… in this case, I guess we have another way of setting min size for docked windows. Else, it’s pure regression. Anyone know what would be this way?