The keyboard layout icon behaves strangly

When I click the icon in the panel and select another layout nothing happens. The only way I can change layout by shortcut - in my case alt+space.
Also if I leave the writing program, for instance Kate - and after a while I come back to continue writing the keyboard layout automatically changes back to the default layout so I have to use the shortcut again to continue.
Also when I write an email in firefox gmail, only the default layout works - us. I can't switch to any other language layout.

We use fcitx

You can open


I did not know about this.