Detect a change in layout in bpy.data.screens ?

Can we write a handler that detects a switch by the user to a different layout, and run a function?

There is no callback, you can only check periodically and compare width/height/x/y of regions.