Fix terminal focus and virtual keyboard issues
Hi,
I noticed a few issues related to terminal focus and how the virtual keyboard doesn't show up when it should (except when starting the app).
Currently, the terminal is not focused after:
- a dialog is closed
- an action from the menu is performed
- after a click/tap on the terminal
And when the terminal is force-focused, the virtual keyboard is not shown. It is indeed desirable that it's not shown most focus forces, excerpt when the user taps the terminal, probably doing this to focus & bring back the virtual keyboard.
This PR aims to fix all this.
I added force focuses after many actions, this might not be very elegant and there may be a better way, but I'm a noob at both qmlkonsole and QML itself and I'll be happy to adapt the code. I didn't see obvious ways to do this. I thought we could automatically force focus after any menu item is triggered, but this is probably not what we want, the focus should not always be given to the terminal after any menu actions, only those injecting keyboard codes, mostly.
I noticed keyboard injection is already supposed to force focus the terminal, but I'm afraid there's something like: the menu item is tapped, the keyboard code is injected, the focus is forced, and them the menu disappears and this somehow loses the terminal focus.
(my environment: plasma desktop and plasma mobile)