The given situation is shown in the following figure.
Clearly when mass m starts moving under gravity, hence net force on the system in horizontal direction is zero. Therefore, centre of mass of the system will not move in horizontal direction. Now, for vertical direction there is a net force that is the mass of the wedge and the block and hence the centre of mass changes in this direction.