C'mon ... people figured this out in 70s ... and centuries before that in various parts of the world.
You put a shade above the window the excludes direct summer sun, but allows direct winter sun to enter the window. The angle and extent of the shade depends on where you are in the world.
On my old adobe in New Mexico, a roof at about 30 degrees with about an 18" overhang prevents all direct summer sun from entering our south facing windows, but provides 6-10F of additional ambient temperature during the winter from direct sunlight.