Use QWindow::windowHandle()->winId() to replace QWidget::winId() due to a bug of Qt5.
Trim input text. Fixes lxde/lxde-qt#139