From 6b1bc1e845d911723f5582c511f49d5f1f8b1edb Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sat, 10 Apr 2021 14:58:15 +0400 Subject: [PATCH] Check if the window is not overlapped when is not active --- Telegram/SourceFiles/mainwindow.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp index 9bad8c5f5..f60968c5d 100644 --- a/Telegram/SourceFiles/mainwindow.cpp +++ b/Telegram/SourceFiles/mainwindow.cpp @@ -557,8 +557,13 @@ bool MainWindow::doWeMarkAsRead() { if (!_main || Ui::isLayerShown()) { return false; } - updateIsActive(); - return isActive() && _main->doWeMarkAsRead(); + // for tile grid in case other windows have shadows + // i've seen some windows with >70px shadow margins + const auto margin = style::ConvertScale(100); + return Ui::IsContentVisible( + this, + inner().marginsRemoved(QMargins(margin, margin, margin, margin))) + && _main->doWeMarkAsRead(); } void MainWindow::checkHistoryActivation() {