I'm using the keyboard shortcut option+shift+command+L to select the next source in the input menu. When I'm doing language work I frequently have to switch between Arabic and English keyboard layouts/languages.
When I switch keyboards using this shortcut the change doesn't always take effect. Sometimes I have to press the shortcut 3 or more times to get the text that I'm entering to be in the desired language. Every time I press the shortcut the flag for the keyboard layout changes as expected, but this doesn't always correspond with what that actual keyboard input is when I start typing (sometimes when the arabic language flag is shown the keyboard layout is still in english and vice versa).
Interestingly, when I switch the keyboard using the mouse and clicking on the flag in the menu bar, everything works exactly as expected. The flag changes and the typing input always matches the flag show in in the menu.
I also have the "automatically switch to document's input source" box unchecked — found in System Preferences > Keyboard.
I'm using a Macbook Pro Retina Mac OSX 10.9.4