If the keyboard layout is changed after X11 has launched (with startx, or because boot to desktop has been selected on an earlier boot), Xorg does not appear to recognise the keyboard change until the next restart (or physical re-plug of the keyboard).
Rather than force a reboot after every change, I believe a sufficient solution is to add:
If the keyboard layout is changed after X11 has launched (with startx, or because boot to desktop has been selected on an earlier boot), Xorg does not appear to recognise the keyboard change until the next restart (or physical re-plug of the keyboard).
Rather than force a reboot after every change, I believe a sufficient solution is to add: