2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 23:45:44 +00:00

Fixed dead keys in photo / file caption input field #1418

Another attempt to fix dead keys input problem after main
window looses focus to popup menu or photo viewer #2007 #1074
This commit is contained in:
John Preston
2016-06-24 19:43:46 +03:00
parent 12c20faa44
commit f6af535f8f
5 changed files with 31 additions and 9 deletions

View File

@@ -926,13 +926,26 @@ void MainWindow::layerHidden() {
setInnerFocus();
}
void MainWindow::onReActivate() {
if (auto w = App::wnd()) {
if (auto f = QApplication::focusWidget()) {
f->clearFocus();
}
w->windowHandle()->requestActivate();
w->activate();
if (auto f = QApplication::focusWidget()) {
f->clearFocus();
}
w->setInnerFocus();
}
}
void MainWindow::hideMediaview() {
if (_mediaView && !_mediaView->isHidden()) {
_mediaView->hide();
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
if (App::wnd()) {
App::wnd()->activateWindow();
}
onReActivate();
QTimer::singleShot(200, this, SLOT(onReActivate()));
#endif
}
}