compositor: Use g_clear_signal_handler to disconnect signal handlers

This also exposed wrong types used for the signal handler ids.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/385
This commit is contained in:
Jonas Ådahl 2019-08-14 10:39:53 +02:00 committed by Marco Trevisan
parent 93c7d571af
commit d20f6c7969
3 changed files with 9 additions and 28 deletions

View File

@ -15,7 +15,7 @@ libmutter_api_version = '@0@'.format(api_version)
# generic version requirements
fribidi_req = '>= 1.0.0'
glib_req = '>= 2.56'
glib_req = '>= 2.61.1'
gi_req = '>= 0.9.5'
gtk3_req = '>= 3.19.8'
gdk_pixbuf_req = '>= 2.0'

View File

@ -20,8 +20,8 @@ struct _MetaCompositor
guint pre_paint_func_id;
guint post_paint_func_id;
guint stage_presented_id;
guint stage_after_paint_id;
gulong stage_presented_id;
gulong stage_after_paint_id;
gint64 server_time_query_time;
gint64 server_time_offset;

View File

@ -1097,12 +1097,8 @@ meta_compositor_sync_stack (MetaCompositor *compositor,
if (compositor->top_window_actor == top_window_actor)
return;
if (compositor->top_window_actor)
{
g_signal_handler_disconnect (compositor->top_window_actor,
compositor->top_window_actor_destroy_id);
compositor->top_window_actor_destroy_id = 0;
}
g_clear_signal_handler (&compositor->top_window_actor_destroy_id,
compositor->top_window_actor);
compositor->top_window_actor = top_window_actor;
@ -1324,31 +1320,16 @@ meta_compositor_dispose (GObject *object)
{
MetaCompositor *compositor = META_COMPOSITOR (object);
if (compositor->stage)
{
g_signal_handler_disconnect (compositor->stage,
compositor->stage_after_paint_id);
g_signal_handler_disconnect (compositor->stage,
compositor->stage_presented_id);
compositor->stage_after_paint_id = 0;
compositor->stage_presented_id = 0;
compositor->stage = NULL;
}
g_clear_signal_handler (&compositor->stage_after_paint_id, compositor->stage);
g_clear_signal_handler (&compositor->stage_presented_id, compositor->stage);
g_clear_handle_id (&compositor->pre_paint_func_id,
clutter_threads_remove_repaint_func);
g_clear_handle_id (&compositor->post_paint_func_id,
clutter_threads_remove_repaint_func);
if (compositor->top_window_actor)
{
g_signal_handlers_disconnect_by_func (compositor->top_window_actor,
on_top_window_actor_destroyed,
compositor);
compositor->top_window_actor = NULL;
compositor->top_window_actor_destroy_id = 0;
}
g_clear_signal_handler (&compositor->top_window_actor_destroy_id,
compositor->top_window_actor);
g_clear_pointer (&compositor->window_group, clutter_actor_destroy);
g_clear_pointer (&compositor->top_window_group, clutter_actor_destroy);