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

View file

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