Better restore keyboard layout when closing OSK
Pick a layout based on the current input purpose. This avoids showing e.g. the emoji layout again after swipe closing.
There's still some cases where going back from a special layout isn't perfect but that should mostly be of concern when the previous layout was terminal.
Edited by Guido Günther