mirror of
https://github.com/brl/mutter.git
synced 2024-11-28 19:10:43 -05:00
cleanup: Use g_clear_handle_id() for g_source_remove()
It makes sure we do not forget to zero the id and lets us avoid zero checks before. We use it for all new code, lets clean up the existing code base. https://gitlab.gnome.org/GNOME/mutter/merge_requests/947
This commit is contained in:
parent
51f68f1054
commit
8e172aeecb
@ -310,11 +310,7 @@ cally_actor_finalize (GObject *obj)
|
||||
|
||||
_cally_actor_clean_action_list (cally_actor);
|
||||
|
||||
if (priv->action_idle_handler)
|
||||
{
|
||||
g_source_remove (priv->action_idle_handler);
|
||||
priv->action_idle_handler = 0;
|
||||
}
|
||||
g_clear_handle_id (&priv->action_idle_handler, g_source_remove);
|
||||
|
||||
if (priv->action_queue)
|
||||
{
|
||||
|
@ -247,11 +247,7 @@ cally_text_finalize (GObject *obj)
|
||||
/* g_object_unref (cally_text->priv->textutil); */
|
||||
/* cally_text->priv->textutil = NULL; */
|
||||
|
||||
if (cally_text->priv->insert_idle_handler)
|
||||
{
|
||||
g_source_remove (cally_text->priv->insert_idle_handler);
|
||||
cally_text->priv->insert_idle_handler = 0;
|
||||
}
|
||||
g_clear_handle_id (&cally_text->priv->insert_idle_handler, g_source_remove);
|
||||
|
||||
G_OBJECT_CLASS (cally_text_parent_class)->finalize (obj);
|
||||
}
|
||||
|
@ -257,8 +257,7 @@ click_action_cancel_long_press (ClutterClickAction *action)
|
||||
|
||||
actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action));
|
||||
|
||||
g_source_remove (priv->long_press_id);
|
||||
priv->long_press_id = 0;
|
||||
g_clear_handle_id (&priv->long_press_id, g_source_remove);
|
||||
|
||||
g_signal_emit (action, click_signals[LONG_PRESS], 0,
|
||||
actor,
|
||||
@ -373,11 +372,7 @@ on_captured_event (ClutterActor *stage,
|
||||
/* disconnect the capture */
|
||||
g_clear_signal_handler (&priv->capture_id, priv->stage);
|
||||
|
||||
if (priv->long_press_id != 0)
|
||||
{
|
||||
g_source_remove (priv->long_press_id);
|
||||
priv->long_press_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&priv->long_press_id, g_source_remove);
|
||||
|
||||
if (!clutter_actor_contains (actor, clutter_event_get_source (event)))
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
@ -459,11 +454,7 @@ clutter_click_action_set_actor (ClutterActorMeta *meta,
|
||||
priv->stage = NULL;
|
||||
}
|
||||
|
||||
if (priv->long_press_id != 0)
|
||||
{
|
||||
g_source_remove (priv->long_press_id);
|
||||
priv->long_press_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&priv->long_press_id, g_source_remove);
|
||||
|
||||
click_action_set_pressed (action, FALSE);
|
||||
click_action_set_held (action, FALSE);
|
||||
@ -542,11 +533,7 @@ clutter_click_action_dispose (GObject *gobject)
|
||||
|
||||
g_clear_signal_handler (&priv->capture_id, priv->stage);
|
||||
|
||||
if (priv->long_press_id)
|
||||
{
|
||||
g_source_remove (priv->long_press_id);
|
||||
priv->long_press_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&priv->long_press_id, g_source_remove);
|
||||
|
||||
G_OBJECT_CLASS (clutter_click_action_parent_class)->dispose (gobject);
|
||||
}
|
||||
|
@ -197,8 +197,8 @@ stop_secondary_click_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
if (device->ptr_a11y_data->secondary_click_timer)
|
||||
{
|
||||
g_source_remove (device->ptr_a11y_data->secondary_click_timer);
|
||||
device->ptr_a11y_data->secondary_click_timer = 0;
|
||||
g_clear_handle_id (&device->ptr_a11y_data->secondary_click_timer,
|
||||
g_source_remove);
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
@ -511,8 +511,7 @@ stop_dwell_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
if (device->ptr_a11y_data->dwell_timer)
|
||||
{
|
||||
g_source_remove (device->ptr_a11y_data->dwell_timer);
|
||||
device->ptr_a11y_data->dwell_timer = 0;
|
||||
g_clear_handle_id (&device->ptr_a11y_data->dwell_timer, g_source_remove);
|
||||
device->ptr_a11y_data->dwell_gesture_started = FALSE;
|
||||
|
||||
g_signal_emit_by_name (device->device_manager,
|
||||
|
@ -1763,11 +1763,7 @@ clutter_text_dispose (GObject *gobject)
|
||||
g_clear_signal_handler (&priv->settings_changed_id,
|
||||
clutter_get_default_backend ());
|
||||
|
||||
if (priv->password_hint_id)
|
||||
{
|
||||
g_source_remove (priv->password_hint_id);
|
||||
priv->password_hint_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&priv->password_hint_id, g_source_remove);
|
||||
|
||||
clutter_text_set_buffer (self, NULL);
|
||||
|
||||
@ -2450,8 +2446,7 @@ clutter_text_key_press (ClutterActor *actor,
|
||||
|
||||
if (priv->show_password_hint)
|
||||
{
|
||||
if (priv->password_hint_id != 0)
|
||||
g_source_remove (priv->password_hint_id);
|
||||
g_clear_handle_id (&priv->password_hint_id, g_source_remove);
|
||||
|
||||
priv->password_hint_visible = TRUE;
|
||||
priv->password_hint_id =
|
||||
|
@ -245,7 +245,7 @@ test_materials (TestUtilsGTestFixture *fixture,
|
||||
|
||||
clutter_main ();
|
||||
|
||||
g_source_remove (idle_source);
|
||||
g_clear_handle_id (&idle_source, g_source_remove);
|
||||
|
||||
if (cogl_test_verbose ())
|
||||
g_print ("OK\n");
|
||||
|
@ -199,7 +199,7 @@ test_multitexture (TestUtilsGTestFixture *fixture,
|
||||
|
||||
clutter_main ();
|
||||
|
||||
g_source_remove (idle_source);
|
||||
g_clear_handle_id (&idle_source, g_source_remove);
|
||||
|
||||
if (cogl_test_verbose ())
|
||||
g_print ("OK\n");
|
||||
|
@ -165,7 +165,7 @@ test_readpixels (TestUtilsGTestFixture *fixture,
|
||||
clutter_actor_show (stage);
|
||||
clutter_main ();
|
||||
|
||||
g_source_remove (idle_source);
|
||||
g_clear_handle_id (&idle_source, g_source_remove);
|
||||
|
||||
/* Remove all of the actors from the stage */
|
||||
clutter_actor_remove_all_children (stage);
|
||||
|
@ -129,7 +129,7 @@ test_texture_mipmaps (TestUtilsGTestFixture *fixture,
|
||||
|
||||
clutter_main ();
|
||||
|
||||
g_source_remove (idle_source);
|
||||
g_clear_handle_id (&idle_source, g_source_remove);
|
||||
|
||||
if (cogl_test_verbose ())
|
||||
g_print ("OK\n");
|
||||
|
@ -228,7 +228,7 @@ test_texture_pixmap_x11 (TestUtilsGTestFixture *fixture,
|
||||
|
||||
g_clear_signal_handler (&paint_handler, state.stage);
|
||||
|
||||
g_source_remove (idle_handler);
|
||||
g_clear_handle_id (&idle_handler, g_source_remove);
|
||||
|
||||
XFreePixmap (state.display, state.pixmap);
|
||||
|
||||
|
@ -249,7 +249,7 @@ test_vertex_buffer_contiguous (TestUtilsGTestFixture *fixture,
|
||||
cogl_object_unref (state.material);
|
||||
cogl_object_unref (state.texture);
|
||||
|
||||
g_source_remove (idle_source);
|
||||
g_clear_handle_id (&idle_source, g_source_remove);
|
||||
|
||||
if (cogl_test_verbose ())
|
||||
g_print ("OK\n");
|
||||
|
@ -154,7 +154,7 @@ test_vertex_buffer_interleved (TestUtilsGTestFixture *fixture,
|
||||
|
||||
cogl_object_unref (state.buffer);
|
||||
|
||||
g_source_remove (idle_source);
|
||||
g_clear_handle_id (&idle_source, g_source_remove);
|
||||
|
||||
if (cogl_test_verbose ())
|
||||
g_print ("OK\n");
|
||||
|
@ -403,7 +403,7 @@ test_viewport (TestUtilsGTestFixture *fixture,
|
||||
clutter_actor_show (stage);
|
||||
clutter_main ();
|
||||
|
||||
g_source_remove (idle_source);
|
||||
g_clear_handle_id (&idle_source, g_source_remove);
|
||||
|
||||
/* Remove all of the actors from the stage */
|
||||
clutter_actor_remove_all_children (stage);
|
||||
|
@ -208,8 +208,7 @@ meta_backend_finalize (GObject *object)
|
||||
g_clear_object (&priv->system_bus);
|
||||
g_clear_object (&priv->upower_proxy);
|
||||
|
||||
if (priv->device_update_idle_id)
|
||||
g_source_remove (priv->device_update_idle_id);
|
||||
g_clear_handle_id (&priv->device_update_idle_id, g_source_remove);
|
||||
|
||||
g_hash_table_destroy (priv->device_monitors);
|
||||
|
||||
|
@ -64,11 +64,7 @@ meta_idle_monitor_watch_fire (MetaIdleMonitorWatch *watch)
|
||||
monitor = watch->monitor;
|
||||
g_object_ref (monitor);
|
||||
|
||||
if (watch->idle_source_id)
|
||||
{
|
||||
g_source_remove (watch->idle_source_id);
|
||||
watch->idle_source_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&watch->idle_source_id, g_source_remove);
|
||||
|
||||
id = watch->id;
|
||||
is_user_active_watch = (watch->timeout_msec == 0);
|
||||
@ -161,11 +157,7 @@ free_watch (gpointer data)
|
||||
|
||||
g_object_ref (monitor);
|
||||
|
||||
if (watch->idle_source_id)
|
||||
{
|
||||
g_source_remove (watch->idle_source_id);
|
||||
watch->idle_source_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&watch->idle_source_id, g_source_remove);
|
||||
|
||||
if (watch->notify != NULL)
|
||||
watch->notify (watch->user_data);
|
||||
|
@ -1232,8 +1232,7 @@ save_config_timeout (gpointer user_data)
|
||||
static void
|
||||
cancel_persistent_confirmation (MetaMonitorManager *manager)
|
||||
{
|
||||
g_source_remove (manager->persistent_timeout_id);
|
||||
manager->persistent_timeout_id = 0;
|
||||
g_clear_handle_id (&manager->persistent_timeout_id, g_source_remove);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -166,8 +166,7 @@ meta_cursor_renderer_native_finalize (GObject *object)
|
||||
MetaCursorRendererNativePrivate *priv =
|
||||
meta_cursor_renderer_native_get_instance_private (renderer);
|
||||
|
||||
if (priv->animation_timeout_id)
|
||||
g_source_remove (priv->animation_timeout_id);
|
||||
g_clear_handle_id (&priv->animation_timeout_id, g_source_remove);
|
||||
|
||||
G_OBJECT_CLASS (meta_cursor_renderer_native_parent_class)->finalize (object);
|
||||
}
|
||||
@ -658,11 +657,7 @@ maybe_schedule_cursor_sprite_animation_frame (MetaCursorRendererNative *native,
|
||||
if (!cursor_change && priv->animation_timeout_id)
|
||||
return;
|
||||
|
||||
if (priv->animation_timeout_id)
|
||||
{
|
||||
g_source_remove (priv->animation_timeout_id);
|
||||
priv->animation_timeout_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&priv->animation_timeout_id, g_source_remove);
|
||||
|
||||
if (cursor_sprite && meta_cursor_sprite_is_animated (cursor_sprite))
|
||||
{
|
||||
|
@ -235,8 +235,7 @@ meta_input_device_native_free_pending_slow_key (gpointer data)
|
||||
SlowKeysEventPending *slow_keys_event = data;
|
||||
|
||||
clutter_event_free (slow_keys_event->event);
|
||||
if (slow_keys_event->timer)
|
||||
g_source_remove (slow_keys_event->timer);
|
||||
g_clear_handle_id (&slow_keys_event->timer, g_source_remove);
|
||||
g_free (slow_keys_event);
|
||||
}
|
||||
|
||||
@ -381,11 +380,7 @@ start_bounce_keys (ClutterEvent *event,
|
||||
static void
|
||||
stop_bounce_keys (MetaInputDeviceNative *device)
|
||||
{
|
||||
if (device->debounce_timer)
|
||||
{
|
||||
g_source_remove (device->debounce_timer);
|
||||
device->debounce_timer = 0;
|
||||
}
|
||||
g_clear_handle_id (&device->debounce_timer, g_source_remove);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -656,11 +651,7 @@ start_toggle_slowkeys (MetaInputDeviceNative *device)
|
||||
static void
|
||||
stop_toggle_slowkeys (MetaInputDeviceNative *device)
|
||||
{
|
||||
if (device->toggle_slowkeys_timer)
|
||||
{
|
||||
g_source_remove (device->toggle_slowkeys_timer);
|
||||
device->toggle_slowkeys_timer = 0;
|
||||
}
|
||||
g_clear_handle_id (&device->toggle_slowkeys_timer, g_source_remove);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -988,11 +979,7 @@ stop_mousekeys_move (MetaInputDeviceNative *device)
|
||||
device->mousekeys_first_motion_time = 0;
|
||||
device->mousekeys_last_motion_time = 0;
|
||||
|
||||
if (device->move_mousekeys_timer)
|
||||
{
|
||||
g_source_remove (device->move_mousekeys_timer);
|
||||
device->move_mousekeys_timer = 0;
|
||||
}
|
||||
g_clear_handle_id (&device->move_mousekeys_timer, g_source_remove);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -4143,7 +4143,8 @@ meta_renderer_native_finalize (GObject *object)
|
||||
{
|
||||
g_list_free_full (renderer_native->power_save_page_flip_onscreens,
|
||||
(GDestroyNotify) cogl_object_unref);
|
||||
g_source_remove (renderer_native->power_save_page_flip_source_id);
|
||||
g_clear_handle_id (&renderer_native->power_save_page_flip_source_id,
|
||||
g_source_remove);
|
||||
}
|
||||
|
||||
g_hash_table_destroy (renderer_native->gpu_datas);
|
||||
|
@ -207,8 +207,7 @@ meta_seat_native_clear_repeat_timer (MetaSeatNative *seat)
|
||||
{
|
||||
if (seat->repeat_timer)
|
||||
{
|
||||
g_source_remove (seat->repeat_timer);
|
||||
seat->repeat_timer = 0;
|
||||
g_clear_handle_id (&seat->repeat_timer, g_source_remove);
|
||||
g_clear_object (&seat->repeat_device);
|
||||
}
|
||||
}
|
||||
|
@ -107,8 +107,7 @@ meta_input_device_x11_finalize (GObject *object)
|
||||
if (device_xi2->group_modes)
|
||||
g_array_unref (device_xi2->group_modes);
|
||||
|
||||
if (device_xi2->inhibit_pointer_query_timer)
|
||||
g_source_remove (device_xi2->inhibit_pointer_query_timer);
|
||||
g_clear_handle_id (&device_xi2->inhibit_pointer_query_timer, g_source_remove);
|
||||
#endif
|
||||
|
||||
G_OBJECT_CLASS (meta_input_device_x11_parent_class)->finalize (object);
|
||||
|
@ -799,8 +799,8 @@ meta_stage_x11_translate_event (MetaStageX11 *stage_x11,
|
||||
* fallback to redrawing the full stage until the cooling
|
||||
* off period is over.
|
||||
*/
|
||||
if (stage_x11->clipped_redraws_cool_off)
|
||||
g_source_remove (stage_x11->clipped_redraws_cool_off);
|
||||
g_clear_handle_id (&stage_x11->clipped_redraws_cool_off,
|
||||
g_source_remove);
|
||||
|
||||
stage_x11->clipped_redraws_cool_off =
|
||||
clutter_threads_add_timeout (1000,
|
||||
|
@ -228,11 +228,7 @@ meta_shaped_texture_dispose (GObject *object)
|
||||
{
|
||||
MetaShapedTexture *stex = (MetaShapedTexture *) object;
|
||||
|
||||
if (stex->remipmap_timeout_id)
|
||||
{
|
||||
g_source_remove (stex->remipmap_timeout_id);
|
||||
stex->remipmap_timeout_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&stex->remipmap_timeout_id, g_source_remove);
|
||||
|
||||
if (stex->paint_tower)
|
||||
meta_texture_tower_free (stex->paint_tower);
|
||||
|
@ -144,8 +144,7 @@ remove_frame_messages_timer (MetaWindowActorX11 *actor_x11)
|
||||
{
|
||||
g_assert (actor_x11->send_frame_messages_timer != 0);
|
||||
|
||||
g_source_remove (actor_x11->send_frame_messages_timer);
|
||||
actor_x11->send_frame_messages_timer = 0;
|
||||
g_clear_handle_id (&actor_x11->send_frame_messages_timer, g_source_remove);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -522,8 +522,7 @@ static void
|
||||
ping_data_free (MetaPingData *ping_data)
|
||||
{
|
||||
/* Remove the timeout */
|
||||
if (ping_data->ping_timeout_id != 0)
|
||||
g_source_remove (ping_data->ping_timeout_id);
|
||||
g_clear_handle_id (&ping_data->ping_timeout_id, g_source_remove);
|
||||
|
||||
g_free (ping_data);
|
||||
}
|
||||
@ -990,13 +989,8 @@ meta_display_close (MetaDisplay *display,
|
||||
|
||||
g_clear_object (&display->gesture_tracker);
|
||||
|
||||
if (display->focus_timeout_id)
|
||||
g_source_remove (display->focus_timeout_id);
|
||||
display->focus_timeout_id = 0;
|
||||
|
||||
if (display->tile_preview_timeout_id)
|
||||
g_source_remove (display->tile_preview_timeout_id);
|
||||
display->tile_preview_timeout_id = 0;
|
||||
g_clear_handle_id (&display->focus_timeout_id, g_source_remove);
|
||||
g_clear_handle_id (&display->tile_preview_timeout_id, g_source_remove);
|
||||
|
||||
if (display->work_area_later != 0)
|
||||
meta_later_remove (display->work_area_later);
|
||||
@ -1254,8 +1248,7 @@ meta_display_queue_autoraise_callback (MetaDisplay *display,
|
||||
window->desc,
|
||||
meta_prefs_get_auto_raise_delay ());
|
||||
|
||||
if (display->autoraise_timeout_id != 0)
|
||||
g_source_remove (display->autoraise_timeout_id);
|
||||
g_clear_handle_id (&display->autoraise_timeout_id, g_source_remove);
|
||||
|
||||
display->autoraise_timeout_id =
|
||||
g_timeout_add_full (G_PRIORITY_DEFAULT,
|
||||
@ -1817,11 +1810,7 @@ meta_display_begin_grab_op (MetaDisplay *display,
|
||||
|
||||
meta_display_update_cursor (display);
|
||||
|
||||
if (display->grab_resize_timeout_id)
|
||||
{
|
||||
g_source_remove (display->grab_resize_timeout_id);
|
||||
display->grab_resize_timeout_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&display->grab_resize_timeout_id, g_source_remove);
|
||||
|
||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||
"Grab op %u on window %s successful\n",
|
||||
@ -1905,11 +1894,7 @@ meta_display_end_grab_op (MetaDisplay *display,
|
||||
|
||||
meta_display_update_cursor (display);
|
||||
|
||||
if (display->grab_resize_timeout_id)
|
||||
{
|
||||
g_source_remove (display->grab_resize_timeout_id);
|
||||
display->grab_resize_timeout_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&display->grab_resize_timeout_id, g_source_remove);
|
||||
|
||||
if (meta_is_wayland_compositor ())
|
||||
meta_display_sync_wayland_input_focus (display);
|
||||
@ -2138,11 +2123,7 @@ meta_display_pong_for_serial (MetaDisplay *display,
|
||||
ping_data);
|
||||
|
||||
/* Remove the timeout */
|
||||
if (ping_data->ping_timeout_id != 0)
|
||||
{
|
||||
g_source_remove (ping_data->ping_timeout_id);
|
||||
ping_data->ping_timeout_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&ping_data->ping_timeout_id, g_source_remove);
|
||||
|
||||
meta_window_set_alive (ping_data->window, TRUE);
|
||||
ping_data_free (ping_data);
|
||||
@ -2624,12 +2605,8 @@ meta_display_sanity_check_timestamps (MetaDisplay *display,
|
||||
void
|
||||
meta_display_remove_autoraise_callback (MetaDisplay *display)
|
||||
{
|
||||
if (display->autoraise_timeout_id != 0)
|
||||
{
|
||||
g_source_remove (display->autoraise_timeout_id);
|
||||
display->autoraise_timeout_id = 0;
|
||||
display->autoraise_window = NULL;
|
||||
}
|
||||
g_clear_handle_id (&display->autoraise_timeout_id, g_source_remove);
|
||||
display->autoraise_window = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
@ -3141,8 +3118,7 @@ meta_display_update_tile_preview (MetaDisplay *display,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (display->tile_preview_timeout_id > 0)
|
||||
g_source_remove (display->tile_preview_timeout_id);
|
||||
g_clear_handle_id (&display->tile_preview_timeout_id, g_source_remove);
|
||||
|
||||
meta_display_update_tile_preview_timeout ((gpointer)display);
|
||||
}
|
||||
@ -3151,8 +3127,7 @@ meta_display_update_tile_preview (MetaDisplay *display,
|
||||
void
|
||||
meta_display_hide_tile_preview (MetaDisplay *display)
|
||||
{
|
||||
if (display->tile_preview_timeout_id > 0)
|
||||
g_source_remove (display->tile_preview_timeout_id);
|
||||
g_clear_handle_id (&display->tile_preview_timeout_id, g_source_remove);
|
||||
|
||||
display->preview_tile_mode = META_TILE_NONE;
|
||||
meta_compositor_hide_tile_preview (display->compositor);
|
||||
|
@ -363,11 +363,7 @@ apply_edge_resistance (MetaWindow *window,
|
||||
resistance_data->timeout_edge_pos < new_pos)))
|
||||
{
|
||||
resistance_data->timeout_setup = FALSE;
|
||||
if (resistance_data->timeout_id != 0)
|
||||
{
|
||||
g_source_remove (resistance_data->timeout_id);
|
||||
resistance_data->timeout_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&resistance_data->timeout_id, g_source_remove);
|
||||
}
|
||||
|
||||
/* Get the range of indices in the edge array that we move past/to. */
|
||||
@ -784,18 +780,14 @@ meta_display_cleanup_edges (MetaDisplay *display)
|
||||
edge_data->bottom_edges = NULL;
|
||||
|
||||
/* Cleanup the timeouts */
|
||||
if (edge_data->left_data.timeout_setup &&
|
||||
edge_data->left_data.timeout_id != 0)
|
||||
g_source_remove (edge_data->left_data.timeout_id);
|
||||
if (edge_data->right_data.timeout_setup &&
|
||||
edge_data->right_data.timeout_id != 0)
|
||||
g_source_remove (edge_data->right_data.timeout_id);
|
||||
if (edge_data->top_data.timeout_setup &&
|
||||
edge_data->top_data.timeout_id != 0)
|
||||
g_source_remove (edge_data->top_data.timeout_id);
|
||||
if (edge_data->bottom_data.timeout_setup &&
|
||||
edge_data->bottom_data.timeout_id != 0)
|
||||
g_source_remove (edge_data->bottom_data.timeout_id);
|
||||
if (edge_data->left_data.timeout_setup)
|
||||
g_clear_handle_id (&edge_data->left_data.timeout_id, g_source_remove);
|
||||
if (edge_data->right_data.timeout_setup)
|
||||
g_clear_handle_id (&edge_data->right_data.timeout_id, g_source_remove);
|
||||
if (edge_data->top_data.timeout_setup)
|
||||
g_clear_handle_id (&edge_data->top_data.timeout_id, g_source_remove);
|
||||
if (edge_data->bottom_data.timeout_setup)
|
||||
g_clear_handle_id (&edge_data->bottom_data.timeout_id, g_source_remove);
|
||||
|
||||
g_free (display->grab_edge_resistance_data);
|
||||
display->grab_edge_resistance_data = NULL;
|
||||
|
@ -180,11 +180,7 @@ meta_close_dialog_default_hide (MetaCloseDialog *dialog)
|
||||
|
||||
dialog_default = META_CLOSE_DIALOG_DEFAULT (dialog);
|
||||
|
||||
if (dialog_default->child_watch_id)
|
||||
{
|
||||
g_source_remove (dialog_default->child_watch_id);
|
||||
dialog_default->child_watch_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&dialog_default->child_watch_id, g_source_remove);
|
||||
|
||||
if (dialog_default->dialog_pid > -1)
|
||||
{
|
||||
@ -207,8 +203,7 @@ meta_close_dialog_default_finalize (GObject *object)
|
||||
|
||||
dialog = META_CLOSE_DIALOG_DEFAULT (object);
|
||||
|
||||
if (dialog->child_watch_id)
|
||||
g_source_remove (dialog->child_watch_id);
|
||||
g_clear_handle_id (&dialog->child_watch_id, g_source_remove);
|
||||
|
||||
if (dialog->dialog_pid > -1)
|
||||
{
|
||||
|
@ -215,8 +215,7 @@ meta_sequence_info_new (MetaGestureTracker *tracker,
|
||||
static void
|
||||
meta_sequence_info_free (MetaSequenceInfo *info)
|
||||
{
|
||||
if (info->autodeny_timeout_id)
|
||||
g_source_remove (info->autodeny_timeout_id);
|
||||
g_clear_handle_id (&info->autodeny_timeout_id, g_source_remove);
|
||||
|
||||
if (info->state == META_SEQUENCE_NONE)
|
||||
meta_gesture_tracker_set_sequence_state (info->tracker, info->sequence,
|
||||
@ -537,11 +536,7 @@ meta_gesture_tracker_set_sequence_state (MetaGestureTracker *tracker,
|
||||
return FALSE;
|
||||
|
||||
/* Unset autodeny timeout */
|
||||
if (info->autodeny_timeout_id)
|
||||
{
|
||||
g_source_remove (info->autodeny_timeout_id);
|
||||
info->autodeny_timeout_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&info->autodeny_timeout_id, g_source_remove);
|
||||
|
||||
info->state = state;
|
||||
g_signal_emit (tracker, signals[STATE_CHANGED], 0, sequence, info->state);
|
||||
|
@ -531,12 +531,8 @@ meta_startup_notification_remove_sequence (MetaStartupNotification *sn,
|
||||
|
||||
g_signal_handlers_disconnect_by_func (seq, on_sequence_completed, sn);
|
||||
|
||||
if (sn->startup_sequences == NULL &&
|
||||
sn->startup_sequence_timeout != 0)
|
||||
{
|
||||
g_source_remove (sn->startup_sequence_timeout);
|
||||
sn->startup_sequence_timeout = 0;
|
||||
}
|
||||
if (sn->startup_sequences == NULL)
|
||||
g_clear_handle_id (&sn->startup_sequence_timeout, g_source_remove);
|
||||
|
||||
g_signal_emit (sn, sn_signals[CHANGED], 0, seq);
|
||||
g_object_unref (seq);
|
||||
@ -572,8 +568,7 @@ meta_startup_notification_finalize (GObject *object)
|
||||
{
|
||||
MetaStartupNotification *sn = META_STARTUP_NOTIFICATION (object);
|
||||
|
||||
if (sn->startup_sequence_timeout)
|
||||
g_source_remove (sn->startup_sequence_timeout);
|
||||
g_clear_handle_id (&sn->startup_sequence_timeout, g_source_remove);
|
||||
|
||||
g_slist_free_full (sn->startup_sequences, g_object_unref);
|
||||
sn->startup_sequences = NULL;
|
||||
|
@ -762,11 +762,7 @@ unref_later (MetaLater *later)
|
||||
static void
|
||||
destroy_later (MetaLater *later)
|
||||
{
|
||||
if (later->source)
|
||||
{
|
||||
g_source_remove (later->source);
|
||||
later->source = 0;
|
||||
}
|
||||
g_clear_handle_id (&later->source, g_source_remove);
|
||||
later->func = NULL;
|
||||
unref_later (later);
|
||||
}
|
||||
|
@ -1430,8 +1430,7 @@ meta_window_unmanage (MetaWindow *window,
|
||||
meta_verbose ("Unmanaging %s\n", window->desc);
|
||||
window->unmanaging = TRUE;
|
||||
|
||||
if (window->unmanage_idle_id)
|
||||
g_source_remove (window->unmanage_idle_id);
|
||||
g_clear_handle_id (&window->unmanage_idle_id, g_source_remove);
|
||||
|
||||
meta_window_free_delete_dialog (window);
|
||||
|
||||
@ -1540,11 +1539,7 @@ meta_window_unmanage (MetaWindow *window,
|
||||
invalidate_work_areas (window);
|
||||
}
|
||||
|
||||
if (window->sync_request_timeout_id)
|
||||
{
|
||||
g_source_remove (window->sync_request_timeout_id);
|
||||
window->sync_request_timeout_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&window->sync_request_timeout_id, g_source_remove);
|
||||
|
||||
if (window->display->grab_window == window)
|
||||
meta_display_end_grab_op (window->display, timestamp);
|
||||
@ -6341,11 +6336,7 @@ update_resize (MetaWindow *window,
|
||||
}
|
||||
|
||||
/* Remove any scheduled compensation events */
|
||||
if (window->display->grab_resize_timeout_id)
|
||||
{
|
||||
g_source_remove (window->display->grab_resize_timeout_id);
|
||||
window->display->grab_resize_timeout_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&window->display->grab_resize_timeout_id, g_source_remove);
|
||||
|
||||
meta_window_get_frame_rect (window, &old);
|
||||
|
||||
@ -8226,8 +8217,7 @@ queue_focus_callback (MetaDisplay *display,
|
||||
focus_data->pointer_x = pointer_x;
|
||||
focus_data->pointer_y = pointer_y;
|
||||
|
||||
if (display->focus_timeout_id != 0)
|
||||
g_source_remove (display->focus_timeout_id);
|
||||
g_clear_handle_id (&display->focus_timeout_id, g_source_remove);
|
||||
|
||||
display->focus_timeout_id =
|
||||
g_timeout_add_full (G_PRIORITY_DEFAULT,
|
||||
|
@ -313,7 +313,7 @@ timeline_base (TestConformSimpleFixture *fixture,
|
||||
timeline_data_destroy (&data_2);
|
||||
timeline_data_destroy (&data_3);
|
||||
|
||||
g_source_remove (delay_tag);
|
||||
g_clear_handle_id (&delay_tag, g_source_remove);
|
||||
|
||||
clutter_actor_destroy (stage);
|
||||
}
|
||||
|
@ -229,11 +229,7 @@ button_release_cb (ClutterActor *actor,
|
||||
|
||||
/* Stop the automatic cycling if the user want to manually control
|
||||
* which shader to display */
|
||||
if (timeout_id)
|
||||
{
|
||||
g_source_remove (timeout_id);
|
||||
timeout_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&timeout_id, g_source_remove);
|
||||
|
||||
if (event->button.button == 1)
|
||||
{
|
||||
|
@ -739,11 +739,7 @@ window_created_cb (MetaDisplay *display,
|
||||
g_signal_connect (window, "unmanaged",
|
||||
G_CALLBACK (window_unmanaged_cb), manager);
|
||||
|
||||
if (manager->xserver_grace_period_id)
|
||||
{
|
||||
g_source_remove (manager->xserver_grace_period_id);
|
||||
manager->xserver_grace_period_id = 0;
|
||||
}
|
||||
g_clear_handle_id (&manager->xserver_grace_period_id, g_source_remove);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -246,11 +246,7 @@ meta_x11_display_dispose (GObject *object)
|
||||
x11_display->gdk_display = NULL;
|
||||
}
|
||||
|
||||
if (x11_display->display_close_idle)
|
||||
{
|
||||
g_source_remove (x11_display->display_close_idle);
|
||||
x11_display->display_close_idle = 0;
|
||||
}
|
||||
g_clear_handle_id (&x11_display->display_close_idle, g_source_remove);
|
||||
|
||||
g_free (x11_display->name);
|
||||
x11_display->name = NULL;
|
||||
|
@ -150,7 +150,7 @@ new_ice_connection (IceConn connection, IcePointer client_data, Bool opening,
|
||||
{
|
||||
input_id = GPOINTER_TO_UINT ((gpointer) *watch_data);
|
||||
|
||||
g_source_remove (input_id);
|
||||
g_clear_handle_id (&input_id, g_source_remove);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3843,8 +3843,7 @@ meta_window_x11_update_sync_request_counter (MetaWindow *window,
|
||||
window->display->grab_latest_motion_x,
|
||||
window->display->grab_latest_motion_y);
|
||||
|
||||
g_source_remove (window->sync_request_timeout_id);
|
||||
window->sync_request_timeout_id = 0;
|
||||
g_clear_handle_id (&window->sync_request_timeout_id, g_source_remove);
|
||||
|
||||
/* This means we are ready for another configure;
|
||||
* no pointer round trip here, to keep in sync */
|
||||
|
Loading…
Reference in New Issue
Block a user