SNI: Flush before querying item properties

Some apps have a tendency to deadlock after registration (notably
KeePassXC). Now we flush before querying the item properties, so any
pending answer should have left the bus, hopefully avoiding the deadlock
This commit is contained in:
scorpion-26 2023-07-28 18:58:00 +02:00
parent a7862a4242
commit 4a52bb744a

View file

@ -325,6 +325,15 @@ namespace SNI
static TimerResult UpdateWidgets(Box&)
{
// Flush connection, so we hopefully don't deadlock with any client
GError* err = nullptr;
g_dbus_connection_flush_sync(dbusConnection, nullptr, &err);
if (err)
{
LOG("SNI: g_dbus_connection_call_sync failed: " << err->message);
g_error_free(err);
}
if (RuntimeConfig::Get().hasSNI == false || Config::Get().enableSNI == false)
{
// Don't bother