The present-day response of a Galactic disc stellar population to a non-axisymmetric perturbation of the potential has previously been computed through perturbation theory within the phase-space coordinates of the unperturbed axisymmetric system. Such an Eulerian linearized treatment however leads to singularities at resonances, which prevent quantitative comparisons with data. Here, we manage to capture the behaviour of the distribution function (DF) at a resonance in a Lagrangian approach, by averaging the Hamiltonian over fast angle variables and re-expressing the DF in terms of a new set of canonical actions and angles variables valid in the resonant region. We then follow the prescription of Binney (2016), assigning to the resonant DF the time average along the orbits of the axisymmetric DF expressed in the new set of actions and angles. This boils down to phase-mixing the DF in terms of the new angles, such that the DF for trapped orbits only depends on the new set of actions. This opens the way to quantitatively fitting the effects of the bar and spirals to Gaia data in terms of distribution functions in action space.