diff --git a/Telegram/SourceFiles/platform/linux/file_dialog_linux.cpp b/Telegram/SourceFiles/platform/linux/file_dialog_linux.cpp index 63b322670f..9849038599 100644 --- a/Telegram/SourceFiles/platform/linux/file_dialog_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/file_dialog_linux.cpp @@ -131,8 +131,7 @@ GtkDialog *QGtkDialog::gtkDialog() const { void QGtkDialog::exec() { if (auto w = App::wnd()) { - w->onReActivate(); - QTimer::singleShot(200, w, SLOT(onReActivate())); + w->reActivateWindow(); } if (modality() == Qt::ApplicationModal) { // block input to the whole app, including other GTK dialogs diff --git a/Telegram/SourceFiles/ui/widgets/popup_menu.cpp b/Telegram/SourceFiles/ui/widgets/popup_menu.cpp index 1513b690e1..927c29934b 100644 --- a/Telegram/SourceFiles/ui/widgets/popup_menu.cpp +++ b/Telegram/SourceFiles/ui/widgets/popup_menu.cpp @@ -475,8 +475,7 @@ PopupMenu::~PopupMenu() { } #if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 if (auto w = App::wnd()) { - w->onReActivate(); - QTimer::singleShot(200, w, SLOT(onReActivate())); + w->reActivateWindow(); } #endif } diff --git a/Telegram/SourceFiles/window/main_window.cpp b/Telegram/SourceFiles/window/main_window.cpp index c316a73fdf..04a2dd1a74 100644 --- a/Telegram/SourceFiles/window/main_window.cpp +++ b/Telegram/SourceFiles/window/main_window.cpp @@ -125,8 +125,7 @@ void MainWindow::hideMediaview() { if (_mediaView && !_mediaView->isHidden()) { _mediaView->hide(); #if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 - onReActivate(); - QTimer::singleShot(200, this, SLOT(onReActivate())); + reActivateWindow(); #endif } } diff --git a/Telegram/SourceFiles/window/main_window.h b/Telegram/SourceFiles/window/main_window.h index 0698e3288f..4198903abf 100644 --- a/Telegram/SourceFiles/window/main_window.h +++ b/Telegram/SourceFiles/window/main_window.h @@ -55,6 +55,11 @@ public: return _titleText; } + void reActivateWindow() { + onReActivate(); + QTimer::singleShot(200, this, SLOT(onReActivate())); + } + void showPhoto(const PhotoOpenClickHandler *lnk, HistoryItem *item = 0); void showPhoto(PhotoData *photo, HistoryItem *item); void showPhoto(PhotoData *photo, PeerData *item); diff --git a/Telegram/SourceFiles/window/notifications_manager.cpp b/Telegram/SourceFiles/window/notifications_manager.cpp index ff0316d2d6..3bc458644b 100644 --- a/Telegram/SourceFiles/window/notifications_manager.cpp +++ b/Telegram/SourceFiles/window/notifications_manager.cpp @@ -63,8 +63,7 @@ void Manager::notificationActivated(PeerId peerId, MsgId msgId) { auto history = App::history(peerId); window->showFromTray(); #if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 - window->onReActivate(); - QTimer::singleShot(200, window, SLOT(onReActivate())); + window->reActivateWindow(); #endif if (App::passcoded()) { window->setInnerFocus();