Make dark mode update go through Qt code on Linux

This makes the behavior consistent and is possible now thanks to a Qt patch
This commit is contained in:
Ilya Fedin 2023-08-18 16:13:13 +04:00 committed by John Preston
parent 92fec8304e
commit 07bbfd1353
2 changed files with 6 additions and 1 deletions

View File

@ -16,6 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/random.h"
#include <QtCore/QAbstractEventDispatcher>
#include <qpa/qwindowsysteminterface.h>
#include <glibmm.h>
#include <gio/gio.hpp>
@ -212,6 +213,9 @@ LinuxIntegration::LinuxIntegration()
const Glib::VariantBase &value) {
if (group == "org.freedesktop.appearance"
&& key == "color-scheme") {
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
QWindowSystemInterface::handleThemeChange();
#else // Qt >= 6.5.0
try {
const auto ivalue = value.get_dynamic<uint>();
@ -220,6 +224,7 @@ LinuxIntegration::LinuxIntegration()
});
} catch (...) {
}
#endif // Qt < 6.5.0
}
}) {
LOG(("Icon theme: %1").arg(QIcon::themeName()));

View File

@ -59,7 +59,7 @@ FROM builder AS patches
RUN git init patches \
&& cd patches \
&& git remote add origin {{ GIT }}/desktop-app/patches.git \
&& git fetch --depth=1 origin edafe1a2484cd6ac9be357aa1e4cda61bf6a8b9a \
&& git fetch --depth=1 origin dbd8a5b00f5a0e7e09b11878b9e46afeb4b593c0 \
&& git reset --hard FETCH_HEAD \
&& rm -rf .git