Ok, I've figured out exactly how CodeTyphon fixed this bug. It seems that what they're doing differently that corrects the error isn't in the GlassDocking code, but in the code for the IDE itself. More specifically, in the file mainbar.pas they've changed the procedure "TMainIDEBar.DoSetMainIDEHeight" to consist of a single line:
procedure TMainIDEBar.DoSetMainIDEHeight(const AIDEIsMaximized: Boolean; ANewHeight: Integer);
begin
if ANewHeight < 25 then ANewHeight := 25;
end;
I copy and pasted this implementation of the procedure into the Lazarus version of mainbar.pas, rebuilt the IDE, and the bug seems to be completely gone. I even spent about half an hour going out of my way to set up weird docking layouts and then closing and re-opening the IDE, and it has never recurred.
The method makes no sense. It is essentially a no-op as ANewHeight is not a var parameter. Why not make an empty method instead?
I wanted to make tests with the code but for some reason I cannot reproduce the bug now. I am testing under Wine, maybe that has an effect.
So, I must analyse the code instead ...
The essential part of method
TMainIDEBar.DoSetMainIDEHeight is this:
if Assigned(IDEDockMaster) then
begin
if EnvironmentOptions.Desktop.AutoAdjustIDEHeight then
IDEDockMaster.AdjustMainIDEWindowHeight(Self, True, ANewHeight)
else
IDEDockMaster.AdjustMainIDEWindowHeight(Self, False, 0);
end else
...
The "else" part is for non-docked IDE and does not matter here.
If you turn off the "
Automatically adjust IDE main window height" option, does it solve the problem?
If it does then it can be used as a workaround instead of changing code.
If not, then the problem must be in
TIDEAnchorDockMaster.AdjustMainIDEWindowHeight.
I believe the exact error can be spotted by eliminating pieces of code and debugging.
I leave it to somebody who actually can reproduce the error. Anyway, looks like we a near solving this properly. Cool!
[Edit]
If the no-op (empty)
DoSetMainIDEHeight solved the problem for a docked IDE, then the calls to
IDEDockMaster.AdjustMainIDEWindowHeight can be removed and
TIDEAnchorDockMaster.AdjustMainIDEWindowHeight, too, because it is not called from anywhere else.
Is this correct?