I have a problem here. It is a strange problem related to ibus.
This is an example of the problem. First, I typed something Japanese using ibus-mozc on kwrite (a text editor for KDE), Tagaini Jisho (a Japanese dictionary), LibreOffice Writer or Geany (a text editor).
Then, I switched to Firefox window using alt+tab and typed something Japanese on search bar, Google search box (on Google site) or Google Translate and then press enter.
Then, I switched back to the app before I switched to Firefox and typed something with ibus-mozc still active, but it didn't produce Japanese anymore and I need to close the app and launch it again to get ibus-mozc working.
This doesn't happen if I do the same, but with Chromium and Geany replaced Firefox in the process.
Oh, this happens too when Midori replaced Firefox and in the process.
I'm confused because Geany and Chromium is a GTK-based, but it didn't cause any problem like that.
I want to use scim-anthy, but it seems like that package is no longer available.
*** New information
Nope. I don't need to close kwrite if I typed something with ibus-mozc on Firefox and then switch back to kwrite to write Japanese. I just need to wait until Firefox loaded the page fully (until the favicon appears on the tab) and it seems like it is the main cause.
Seems like the problem is now solved.
But, still... I need likely an hour to figure this out. So I am a bit curious about how these behavior exists.