From 72e34dc5b1baf1d947b96eadad1057a10a0f3a44 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 1 Jan 2017 21:49:44 +0400 Subject: [PATCH] Fixed alpha 0.10.23 build for Linux. --- Telegram/SourceFiles/platform/linux/file_dialog_linux.cpp | 3 +-- Telegram/SourceFiles/ui/widgets/popup_menu.cpp | 3 +-- Telegram/SourceFiles/window/main_window.cpp | 3 +-- Telegram/SourceFiles/window/main_window.h | 5 +++++ Telegram/SourceFiles/window/notifications_manager.cpp | 3 +-- 5 files changed, 9 insertions(+), 8 deletions(-) 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();