Alright, I've been playing around with this a bunch more and I believe I've found a "real" solution. By which I mean I'm pretty confident I've fixed the root bug in TMainIDEBar.CalcMainIDEHeight that in turn was causing the problem with TMainIDEBar.DoSetMainIDEHeight.
No, I am sorry to say but you did not fix the root bug. What more, your solution breaks the palette height calculation especially when the buttons are split into 2 rows.
The relevant change starts at line 34 of the code snippet. The bug is avoided by setting that particular instance of NewHeight directly to 55 (which seems to be the "ideal" value for it in the first place) instead of pointlessly calculating it based on the palette button height and page control height. Again, this solution is a replacement for the one I posted earlier, not an addition. TMainIDEBar.DoSetMainIDEHeight does not need to be altered in the manner I indicated... only TMainIDEBar.CalcMainIDEHeight, as shown above.
The main window + palette are now too low always with my widgetset and 2 rows of buttons are not taken into account for obvious reasons.
The code is also frankly speaking quite stupid because the same value 55 is used inside a loop again and again. You could have dumped the whole loop.
Question:
Does unchecking the "Show complete component palette" option solve the problem as a workaround?
If it doesn't, then unchecking the "Automatically adjust IDE main window height" option certainly does. (?)
If there is such an easy workaround, what is all the fuzz about? Or, did nobody realize there is such a workaround?
I wonder why I didn't get answers for my questions earlier. For example the replacement DoSetMainIDEHeight method looked like a no-operation to me. Is it really so or did I miss some important detail?
It was considered a valid temporary fix by many people (including GetMem who surely is a good programmer) although it completely broke the height calculation also for non-docked IDE.
The root problem is not CalcMainIDEHeight. It calculates the height correctly.
The root problem may be how DoSetMainIDEHeight is called. It is called from many places, including the TMainIDEBar.Resizing method which creates the loop.
You should try to reduce the calls by using flag variables.
There may be a LCL layout bug involved, too. If you look at this issue:
http://bugs.freepascal.org/view.php?id=28096it makes no sense. The bounds in the error message are identical. It never should give an error.
Why it happens only at maximized state? Maybe LCL layout has trouble with that.
Anyway, do some experiments please. I still believe it can be fixed.