Don't use crl::on_main unnecessarily with XDP::SettingWatcher

g_dbus_connection_signal_subscribe calls the callback on the same thread
This commit is contained in:
Ilya Fedin 2023-09-03 23:43:15 +04:00 committed by John Preston
parent 119f7e757d
commit 4807244682
1 changed files with 7 additions and 8 deletions

View File

@ -216,14 +216,13 @@ LinuxIntegration::LinuxIntegration()
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
QWindowSystemInterface::handleThemeChange();
#else // Qt >= 6.5.0
try {
const auto ivalue = value.get_dynamic<uint>();
crl::on_main([=] {
Core::App().settings().setSystemDarkMode(ivalue == 1);
});
} catch (...) {
}
Core::Sandbox::Instance().customEnterFromEventLoop([&] {
try {
Core::App().settings().setSystemDarkMode(
value.get_dynamic<uint>() == 1);
} catch (...) {
}
});
#endif // Qt < 6.5.0
}
}) {