mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-03 07:56:03 +00:00
Update online after the window active status.
I hope this fixes #26059.
This commit is contained in:
@@ -115,16 +115,7 @@ MainWindow::MainWindow(not_null<Window::Controller*> controller)
|
|||||||
|
|
||||||
void MainWindow::initHook() {
|
void MainWindow::initHook() {
|
||||||
Platform::MainWindow::initHook();
|
Platform::MainWindow::initHook();
|
||||||
|
|
||||||
QCoreApplication::instance()->installEventFilter(this);
|
QCoreApplication::instance()->installEventFilter(this);
|
||||||
|
|
||||||
// Non-queued activeChanged handlers must use QtSignalProducer.
|
|
||||||
connect(
|
|
||||||
windowHandle(),
|
|
||||||
&QWindow::activeChanged,
|
|
||||||
this,
|
|
||||||
[=] { checkActivation(); },
|
|
||||||
Qt::QueuedConnection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::applyInitialWorkMode() {
|
void MainWindow::applyInitialWorkMode() {
|
||||||
|
@@ -60,7 +60,7 @@ public:
|
|||||||
|
|
||||||
MainWidget *sessionContent() const;
|
MainWidget *sessionContent() const;
|
||||||
|
|
||||||
void checkActivation();
|
void checkActivation() override;
|
||||||
[[nodiscard]] bool markingAsRead() const;
|
[[nodiscard]] bool markingAsRead() const;
|
||||||
|
|
||||||
bool takeThirdSectionFromLayer();
|
bool takeThirdSectionFromLayer();
|
||||||
|
@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
*/
|
*/
|
||||||
#include "window/main_window.h"
|
#include "window/main_window.h"
|
||||||
|
|
||||||
|
#include "api/api_updates.h"
|
||||||
#include "storage/localstorage.h"
|
#include "storage/localstorage.h"
|
||||||
#include "platform/platform_specific.h"
|
#include "platform/platform_specific.h"
|
||||||
#include "ui/platform/ui_platform_window.h"
|
#include "ui/platform/ui_platform_window.h"
|
||||||
@@ -512,9 +513,13 @@ void MainWindow::handleStateChanged(Qt::WindowState state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::handleActiveChanged() {
|
void MainWindow::handleActiveChanged() {
|
||||||
|
checkActivation();
|
||||||
if (isActiveWindow()) {
|
if (isActiveWindow()) {
|
||||||
Core::App().windowActivated(&controller());
|
Core::App().windowActivated(&controller());
|
||||||
}
|
}
|
||||||
|
if (const auto controller = sessionController()) {
|
||||||
|
controller->session().updates().updateOnline();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::handleVisibleChanged(bool visible) {
|
void MainWindow::handleVisibleChanged(bool visible) {
|
||||||
|
@@ -148,6 +148,8 @@ protected:
|
|||||||
void handleActiveChanged();
|
void handleActiveChanged();
|
||||||
void handleVisibleChanged(bool visible);
|
void handleVisibleChanged(bool visible);
|
||||||
|
|
||||||
|
virtual void checkActivation() {
|
||||||
|
}
|
||||||
virtual void initHook() {
|
virtual void initHook() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user