I saw your comment in the previous pullrequest #332 but why here and not at insert time? This will be done for each relayout (so a lot) while it's really needed only if the previous keysig change no?