Umar bin Khattab and Uthman bin Affan used to do that.
حدثنا القعنبي عن مالك عن ابن شهاب
أن عمر بن الخطاب وعثمان بن عفان كانا يفعلان ذلك
Bukhari narrated it in the Book of Prayer, chapter on lying on one's back in the masjid and stretching out the leg, hadith no. 475, from Qanabi through this route, and it is also in Muwatta 1/172.