diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index 298bba7c02..37346973b5 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -4058,12 +4058,16 @@ begin // they will probably change // to avoid resizes it is better use the defaults GetDefaults(Result); - end else begin + end else + if not (self is TCustomForm) then + begin // -> adjust client rect based on LCL bounds // for example: if the Width in LCL differ from the Width of the Interface // object, then adjust the clientwidth accordingly // this often anticipates later LM_SIZE messages from the interface // and reduces resizes + // BUT: Do this only when not a form. Form has its own clientrect specification: + // https://wiki.lazarus.freepascal.org/Lazarus_FAQ#Why_are_TForm.ClientWidth.2FClientHeight_the_same_as_TForm.Width.2FHeight inc(Result.Right,Width-InterfaceWidth); inc(Result.Bottom,Height-InterfaceHeight); end;