gui: fix race in app list retrival
Signals received for old version of the list should be ignored.
This commit is contained in:
parent
70f2357308
commit
40e244879c
|
@ -2,7 +2,7 @@
|
|||
/*
|
||||
* LADI Session Handler (ladish)
|
||||
*
|
||||
* Copyright (C) 2009 Nedko Arnaudov <nedko@arnaudov.name>
|
||||
* Copyright (C) 2009, 2010 Nedko Arnaudov <nedko@arnaudov.name>
|
||||
*
|
||||
**************************************************************************
|
||||
* This file contains implementation of code that interfaces
|
||||
|
@ -67,7 +67,15 @@ static void on_app_added(void * context, DBusMessage * message_ptr)
|
|||
}
|
||||
|
||||
//log_info("AppAdded signal received. id=%"PRIu64", name='%s', %srunning, %s, level %u", id, name, running ? "" : "not ", terminal ? "terminal" : "shell", (unsigned int)level);
|
||||
proxy_ptr->app_added(proxy_ptr->context, id, name, running, terminal, level);
|
||||
|
||||
if (new_list_version <= proxy_ptr->version)
|
||||
{
|
||||
log_info("Ignoring signal for older version of the app list");
|
||||
}
|
||||
else
|
||||
{
|
||||
proxy_ptr->app_added(proxy_ptr->context, id, name, running, terminal, level);
|
||||
}
|
||||
}
|
||||
|
||||
static void on_app_removed(void * context, DBusMessage * message_ptr)
|
||||
|
@ -88,7 +96,14 @@ static void on_app_removed(void * context, DBusMessage * message_ptr)
|
|||
}
|
||||
|
||||
//log_info("AppRemoved signal received, id=%"PRIu64, id);
|
||||
proxy_ptr->app_removed(proxy_ptr->context, id);
|
||||
if (new_list_version <= proxy_ptr->version)
|
||||
{
|
||||
log_info("Ignoring signal for older version of the app list");
|
||||
}
|
||||
else
|
||||
{
|
||||
proxy_ptr->app_removed(proxy_ptr->context, id);
|
||||
}
|
||||
}
|
||||
|
||||
static void on_app_state_changed(void * context, DBusMessage * message_ptr)
|
||||
|
|
Loading…
Reference in New Issue