move SYNC_PAINT define to right place