If I understand the situation correctly:
Top photo shows the shower curtain rod mounted immediately above the shower "container". (Let's just use the phraseology "shower enclosure")
The 2nd, 3rd and 4th pictures show the paint on the wall immediately above the shower enclosure.
I think what's happening is that the wall immediately above the shower enclosure is getting wet because of water puddling on the top of that shower enclosure. Having any kind of ledge in a shower where water can puddle is a bad idea unless everything around that potential puddle site is water proof, and drywall ain't waterproof.
What I would do is simply remove the peeling paint, repair any water damage to the wall as best you can with drywall joint compound (there is no such thing as "water-proof" drywall joint compound) and then use double sided tape or a weak adhesive to stick some water proof material over the wall above the shower enclosure. You might consider using plastic laminate.
In fact, what I'd probably do is use an acrylic (also called "latex") caulk as an adhesive to stick plastic laminate to the wall. Alternatively, stick a good grade of 2 inch wide painter's masking tape to the wall, and then use double sided carpet tape to stick the laminate to the painter's masking tape. Stick the carpet tape to the painter's masking tape, not to the surface of the drywall itself. That way, removal of the plastic laminate in future won't result in damage to the drywall because the painter's masking tape should pull off the drywall in future without causing any damage.
What's important, however, is that you CAULK the corner between the water proof material (plastic laminate) and the top of the shower enclosure to prevent water from running under the waterproof material and getting onto the wall behind it wet.
Typically, people will use silicone caulk to caulk that joint. However, silicone caulk creates as many problems as it solves because people don't know how to either clean mildew off of silicone caulk, nor do they know how to remove silicone caulk completely so that they can replace it. You might want to use an ordinary latex caulk at this joint so that you can replace it with more latex caulk if it becomes mildewed. Post again if you want me to re-post a write-up I have on how to both replace and clean silicone caulk if you'd prefer to use silicone caulk.
Plastic laminate is very water proof, and you can purchase a 4 X 8 foot sheet of it for about $50 to $75, depending on what style and colour you choose. It can be cut with an inexpensive tool ($3 or so) called a "plastic laminate knife" available at most hardware stores. The plastic laminate knife will not actually CUT the laminate. It allows you to keep scratching the laminate along a line until the scratch is so deep that bending the laminate causes it to break along that line. But, that is how one cuts plastic laminate.
If your waterproof material (plastic laminate, perhaps) doesn't extend all the way to the ceiling, then you want to do something to prevent water from getting behind the plastic laminate at the top (from the shower spray). Even a piece of Scotch tape along the top of the plastic laminate would suffice.
However, a more elegant solution would be to put some acrylic caulk on the back of the plastic laminate before sticking it up in place. Then, as the acrylic caulk squeezed out from behind the plastic laminate, you could wipe it off with a damp sponge to remove it so that it was only behind the laminate, and not oozed out all over the wall above the laminate.