From 3db913f15b15d9dfe1906aea2902b91fdb9f5106 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 13 Jul 2017 19:13:10 +0300 Subject: [PATCH] Remove layer deletion by timer in MainWindow. It could be: schedule deletion -> show new box -> delete it by timer. This fixes the error box display when adding users to groups. --- Telegram/SourceFiles/mainwindow.cpp | 13 +++++-------- Telegram/SourceFiles/mainwindow.h | 1 - 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp index cb6cea686..b0f84367a 100644 --- a/Telegram/SourceFiles/mainwindow.cpp +++ b/Telegram/SourceFiles/mainwindow.cpp @@ -533,13 +533,6 @@ void MainWindow::checkHistoryActivation() { } } -void MainWindow::layerHidden() { - destroyLayerDelayed(); - hideMediaview(); - setInnerFocus(); - checkHistoryActivation(); -} - bool MainWindow::contentOverlapped(const QRect &globalRect) { if (_main && _main->contentOverlapped(globalRect)) return true; if (_layerBg && _layerBg->contentOverlapped(globalRect)) return true; @@ -739,7 +732,11 @@ void MainWindow::noLayerStack(LayerStackWidget *was) { void MainWindow::layerFinishedHide(LayerStackWidget *was) { if (was == _layerBg) { - QTimer::singleShot(0, this, SLOT(layerHidden())); + destroyLayerDelayed(); + InvokeQueued(this, [this] { + setInnerFocus(); + checkHistoryActivation(); + }); } } diff --git a/Telegram/SourceFiles/mainwindow.h b/Telegram/SourceFiles/mainwindow.h index af2634288..9d4094ea9 100644 --- a/Telegram/SourceFiles/mainwindow.h +++ b/Telegram/SourceFiles/mainwindow.h @@ -152,7 +152,6 @@ protected: public slots: void showSettings(); - void layerHidden(); void setInnerFocus(); void updateConnectingStatus();