backported the edge fixes to XCF source files