protected override void OnSizeAllocated(Gdk.Rectangle allocation) { base.OnSizeAllocated(allocation); // Gtk2 Allocation setter simply calls SizeAllocate, so use this directly like with Gtk3 surface.SizeAllocate(new Gdk.Rectangle(0, 0, allocation.Width, allocation.Height)); }