Yes, i did think about this in the shower.
Just to put things into proportion:
This is vienna. Vienna has an area of around 400 km².

And the blue area is the area that would have to be covered by solar panels to produce enough energy for the whole city:

Source: I did the maths myself. I assumed that per person around 30 MWh of energy/year are needed. Data for this: our world in data, energy usage per person. It’s well known that 1 m² of solar panel produces around 200 Wp and that’s 200 kWh/year. So you need about 150 m² of solar cells per person. Vienna has about a million inhabitants, so that makes 150 km² of solar panels approximately.


Vienna has around 68km² of roof surface.
But there are two nice facts that make the whole calculation easier:
So the whole point is kinda moot. If we would put solar on all rooftops in Vienna, it would be enough to cover for the entire remaining fossil-based electricity generation in Austria if we had the means to store that excess energy.