I like to stick with whatever comes with Debian even if a bit old. I compared my virtual machine and regular machine installation and noticed that the difference is in ibus. I have ibus installed for typing Korean characters. Closing ibus actually seemed to fix the issue so the issue is somewhere between Geany and ibus. I ended up replacing ibus with scim. No more problems for now.