Very hard to repair, if you try and glue it, it will probably just pull away again. The worst part is the white stitching, the stitching that holds the zip rots with age. Once this happens the roof is on borrowed time, have a look for a good second hand one (Spurs) or a replacement (Croydon soft tops).
Your window looks to be very good, almost new, it could be that the previous owner has tried to fit a replacement which has resulted in the stitching failing.