Perhaps another title could be "A History of the 20th century", for the central character, Allan Karlsson, seems to have been in on some of the pivotal moments of the 20th century and indeed, met the key players of the 20th Century (at least, through Swedish eyes).
The story is well told and does end happily ever after. It is funny, often unbelievable as a group of the most unlikely characters gather around Allan on his adventures. The story tells the life of Allan born in 1905 as well as the story of what happens after Allan climbs out of the window.