protected override void OnSizeAllocated(Gdk.Rectangle allocation) { base.OnSizeAllocated(allocation); // reduce allocation by border width int bw = (int)BorderWidth; allocation.X += bw; allocation.Y += bw; allocation.Width = Math.Max(1, allocation.Width - 2 * bw); allocation.Height = Math.Max(1, allocation.Height - 2 * bw); if (root != null && root.Visible) { root.SizeAllocate(allocation); } }