Functions to call when window configuration changes. The buffer-local part is run once per window, with the relevant window selected; while the global part is run only once for the modified frame, with the relevant frame selected.