Apart from my comment it looks good, and could be merged whenever we do depend on 3.24 for real (which I don't see any problem myself, 3.24.0 is getting pretty old by now)
Another possibility is to keep the old code and use ifdefs to pick the implementation based on gtk 3.24 availability (but of course there's no need for this if we are going to depend on 3.24).