In preparation for the GTK4 port. This is just a cheap port, I'll implement proper entry completion after porting to GTK4.