mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
backends/kms/update: Add ability to remove result listeners
We may need to remove a result listener once we've added it, and before that it ha been processed, so add support for this. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1952>
This commit is contained in:
parent
fd1f6094c9
commit
4b0a10c562
@ -539,6 +539,28 @@ meta_kms_update_add_result_listener (MetaKmsUpdate *update,
|
|||||||
listener);
|
listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_kms_update_remove_result_listeners (MetaKmsUpdate *update,
|
||||||
|
MetaKmsResultListenerFunc func,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
GList *l;
|
||||||
|
|
||||||
|
for (l = update->result_listeners; l;)
|
||||||
|
{
|
||||||
|
MetaKmsResultListener *listener = l->data;
|
||||||
|
GList *next = l->next;
|
||||||
|
|
||||||
|
if (listener->user_data == func && listener->user_data == user_data)
|
||||||
|
{
|
||||||
|
update->result_listeners =
|
||||||
|
g_list_delete_link (update->result_listeners, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
l = next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GList *
|
GList *
|
||||||
meta_kms_update_take_result_listeners (MetaKmsUpdate *update)
|
meta_kms_update_take_result_listeners (MetaKmsUpdate *update)
|
||||||
{
|
{
|
||||||
|
@ -150,6 +150,10 @@ void meta_kms_update_add_result_listener (MetaKmsUpdate *update,
|
|||||||
MetaKmsResultListenerFunc func,
|
MetaKmsResultListenerFunc func,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
|
void meta_kms_update_remove_result_listeners (MetaKmsUpdate *update,
|
||||||
|
MetaKmsResultListenerFunc func,
|
||||||
|
gpointer user_data);
|
||||||
|
|
||||||
static inline MetaFixed16
|
static inline MetaFixed16
|
||||||
meta_fixed_16_from_int (int16_t d)
|
meta_fixed_16_from_int (int16_t d)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user