We analyze event-by-event fluctuations of the transverse momentum in relativistic heavy-ion collisions at RHIC in the framework based on the fluctuating Glauber-model initial conditions, event-by-event (3+1)-dimensional viscous hydrodynamics, and statistical hadronization. We use the scaled fluctuation measure < Delta p_Ti Delta p_Tj > / << p_T >>. The identified "geometric" mechanism of generating the transverse-momentum fluctuations from the initial size fluctuations, transmitted to the final statistical-hadronization phase with hydrodynamics, is capable of easily reproducing the magnitude of the effect and explains the basic features of the data. On the other hand, it is somewhat too strong, hinting on modification of the popular Glauber approach to the earliest phase of the collision. We have checked that the considered measure is insensitive of the values of the shear and bulk viscosity coefficients, the freeze-out temperature, and the smoothing parameter for the initial distribution. It remains unaltered in the core-corona picture and is insensitive to the transverse-momentum conservation, approximately imposed in the statistical hadronization.