mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-31 07:52:06 +00:00
Fix stop-auto-read when the system is idle.
This commit is contained in:
parent
5b7f7ed70e
commit
b5dcd84513
@ -126,6 +126,7 @@ void Histories::readInboxTill(not_null<HistoryItem*> item) {
|
||||
void Histories::readInboxTill(not_null<History*> history, MsgId tillId) {
|
||||
readInboxTill(history, tillId, false);
|
||||
}
|
||||
|
||||
void Histories::readInboxTill(
|
||||
not_null<History*> history,
|
||||
MsgId tillId,
|
||||
|
@ -674,7 +674,10 @@ void HistoryInner::paintEvent(QPaintEvent *e) {
|
||||
const auto middle = y + h / 2;
|
||||
const auto bottom = y + h;
|
||||
if (_visibleAreaBottom >= bottom) {
|
||||
readTill = view->data();
|
||||
const auto item = view->data();
|
||||
if (!item->out() && item->unread()) {
|
||||
readTill = item;
|
||||
}
|
||||
}
|
||||
if (_visibleAreaBottom >= middle
|
||||
&& _visibleAreaTop <= middle) {
|
||||
@ -704,7 +707,7 @@ void HistoryInner::paintEvent(QPaintEvent *e) {
|
||||
}
|
||||
p.restore();
|
||||
|
||||
if (readTill) {
|
||||
if (readTill && _widget->doWeReadServerHistory()) {
|
||||
session().data().histories().readInboxTill(readTill);
|
||||
}
|
||||
}
|
||||
|
@ -508,7 +508,7 @@ bool MainWindow::doWeMarkAsRead() {
|
||||
return false;
|
||||
}
|
||||
updateIsActive(0);
|
||||
return isActive();
|
||||
return isActive() && _main->doWeMarkAsRead();
|
||||
}
|
||||
|
||||
void MainWindow::checkHistoryActivation() {
|
||||
@ -549,10 +549,12 @@ bool MainWindow::eventFilter(QObject *object, QEvent *e) {
|
||||
} break;
|
||||
|
||||
case QEvent::MouseMove: {
|
||||
if (_main && _main->isIdle()) {
|
||||
const auto position = static_cast<QMouseEvent*>(e)->globalPos();
|
||||
if (_main && _main->isIdle() && _lastMousePosition != position) {
|
||||
Core::App().updateNonIdle();
|
||||
_main->checkIdleFinish();
|
||||
}
|
||||
_lastMousePosition = position;
|
||||
} break;
|
||||
|
||||
case QEvent::MouseButtonRelease: {
|
||||
|
@ -167,6 +167,7 @@ private:
|
||||
QImage icon16, icon32, icon64, iconbig16, iconbig32, iconbig64;
|
||||
|
||||
crl::time _lastTrayClickTime = 0;
|
||||
QPoint _lastMousePosition;
|
||||
|
||||
object_ptr<Window::PasscodeLockWidget> _passcodeLock = { nullptr };
|
||||
object_ptr<Intro::Widget> _intro = { nullptr };
|
||||
|
Loading…
Reference in New Issue
Block a user