Use _once variant of g_[timeout_idle]
Nice helpers that were added in GLib 2.72, so safe to make use of as we depend on 2.81.1 already. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4115>
This commit is contained in:
parent
ae4cdcf205
commit
a5be92e03d
@ -168,7 +168,7 @@ restore_dwell_position (ClutterInputDevice *device)
|
||||
device->ptr_a11y_data->dwell_y);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
trigger_secondary_click (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
@ -182,8 +182,6 @@ trigger_secondary_click (gpointer data)
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_SECONDARY_CLICK,
|
||||
TRUE);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -193,7 +191,7 @@ start_secondary_click_timeout (ClutterInputDevice *device)
|
||||
ClutterSeat *seat = clutter_input_device_get_seat (device);
|
||||
|
||||
device->ptr_a11y_data->secondary_click_timer =
|
||||
g_timeout_add (delay, trigger_secondary_click, device);
|
||||
g_timeout_add_once (delay, trigger_secondary_click, device);
|
||||
|
||||
g_signal_emit_by_name (seat,
|
||||
"ptr-a11y-timeout-started",
|
||||
@ -421,18 +419,16 @@ get_dwell_direction (ClutterInputDevice *device)
|
||||
return CLUTTER_A11Y_DWELL_DIRECTION_DOWN;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
trigger_clear_dwell_gesture (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
|
||||
device->ptr_a11y_data->dwell_timer = 0;
|
||||
device->ptr_a11y_data->dwell_gesture_started = FALSE;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
trigger_dwell_gesture (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
@ -448,15 +444,13 @@ trigger_dwell_gesture (gpointer data)
|
||||
|
||||
/* Do not clear the gesture right away, otherwise we'll start another one */
|
||||
device->ptr_a11y_data->dwell_timer =
|
||||
g_timeout_add (delay, trigger_clear_dwell_gesture, device);
|
||||
g_timeout_add_once (delay, trigger_clear_dwell_gesture, device);
|
||||
|
||||
g_signal_emit_by_name (seat,
|
||||
"ptr-a11y-timeout-stopped",
|
||||
device,
|
||||
CLUTTER_A11Y_TIMEOUT_TYPE_GESTURE,
|
||||
TRUE);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -466,7 +460,7 @@ start_dwell_gesture_timeout (ClutterInputDevice *device)
|
||||
ClutterSeat *seat = clutter_input_device_get_seat (device);
|
||||
|
||||
device->ptr_a11y_data->dwell_timer =
|
||||
g_timeout_add (delay, trigger_dwell_gesture, device);
|
||||
g_timeout_add_once (delay, trigger_dwell_gesture, device);
|
||||
device->ptr_a11y_data->dwell_gesture_started = TRUE;
|
||||
|
||||
g_signal_emit_by_name (seat,
|
||||
@ -476,7 +470,7 @@ start_dwell_gesture_timeout (ClutterInputDevice *device)
|
||||
delay);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
trigger_dwell_click (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
@ -502,8 +496,6 @@ trigger_dwell_click (gpointer data)
|
||||
emit_dwell_click (device, get_dwell_click_type (device));
|
||||
update_dwell_click_type (device);
|
||||
}
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -513,7 +505,7 @@ start_dwell_timeout (ClutterInputDevice *device)
|
||||
ClutterSeat *seat = clutter_input_device_get_seat (device);
|
||||
|
||||
device->ptr_a11y_data->dwell_timer =
|
||||
g_timeout_add (delay, trigger_dwell_click, device);
|
||||
g_timeout_add_once (delay, trigger_dwell_click, device);
|
||||
|
||||
g_signal_emit_by_name (seat,
|
||||
"ptr-a11y-timeout-started",
|
||||
@ -540,7 +532,7 @@ stop_dwell_timeout (ClutterInputDevice *device)
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
trigger_dwell_position_timeout (gpointer data)
|
||||
{
|
||||
ClutterInputDevice *device = data;
|
||||
@ -552,15 +544,13 @@ trigger_dwell_position_timeout (gpointer data)
|
||||
if (!pointer_has_moved (device))
|
||||
start_dwell_timeout (device);
|
||||
}
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
start_dwell_position_timeout (ClutterInputDevice *device)
|
||||
{
|
||||
device->ptr_a11y_data->dwell_position_timer =
|
||||
g_timeout_add (100, trigger_dwell_position_timeout, device);
|
||||
g_timeout_add_once (100, trigger_dwell_position_timeout, device);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2469,7 +2469,7 @@ clutter_text_touch_event (ClutterActor *actor,
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
clutter_text_remove_password_hint (gpointer data)
|
||||
{
|
||||
ClutterText *self = data;
|
||||
@ -2480,8 +2480,6 @@ clutter_text_remove_password_hint (gpointer data)
|
||||
|
||||
clutter_text_dirty_cache (data);
|
||||
clutter_actor_queue_redraw (data); // paint volume was already invalidated by clutter_text_dirty_cache()
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -2561,9 +2559,9 @@ clutter_text_key_press (ClutterActor *actor,
|
||||
|
||||
priv->password_hint_visible = TRUE;
|
||||
priv->password_hint_id =
|
||||
g_timeout_add (priv->password_hint_timeout,
|
||||
clutter_text_remove_password_hint,
|
||||
self);
|
||||
g_timeout_add_once (priv->password_hint_timeout,
|
||||
clutter_text_remove_password_hint,
|
||||
self);
|
||||
}
|
||||
|
||||
return CLUTTER_EVENT_STOP;
|
||||
|
@ -361,7 +361,7 @@ meta_backend_monitors_changed (MetaBackend *backend)
|
||||
update_cursors (backend);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
update_last_device (MetaBackend *backend)
|
||||
{
|
||||
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
|
||||
@ -369,8 +369,6 @@ update_last_device (MetaBackend *backend)
|
||||
priv->device_update_idle_id = 0;
|
||||
g_signal_emit (backend, signals[LAST_DEVICE_CHANGED], 0,
|
||||
priv->current_device);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -391,7 +389,7 @@ meta_backend_update_last_device (MetaBackend *backend,
|
||||
if (priv->device_update_idle_id == 0)
|
||||
{
|
||||
priv->device_update_idle_id =
|
||||
g_idle_add ((GSourceFunc) update_last_device, backend);
|
||||
g_idle_add_once ((GSourceOnceFunc) update_last_device, backend);
|
||||
g_source_set_name_by_id (priv->device_update_idle_id,
|
||||
"[mutter] update_last_device");
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ meta_color_profile_new_from_icc (MetaColorManager *color_manager,
|
||||
return color_profile;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
notify_ready_idle (gpointer user_data)
|
||||
{
|
||||
MetaColorProfile *color_profile = user_data;
|
||||
@ -314,8 +314,6 @@ notify_ready_idle (gpointer user_data)
|
||||
color_profile->notify_ready_id = 0;
|
||||
color_profile->is_ready = TRUE;
|
||||
g_signal_emit (color_profile, signals[READY], 0, TRUE);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
MetaColorProfile *
|
||||
@ -341,8 +339,8 @@ meta_color_profile_new_from_cd_profile (MetaColorManager *color_manager,
|
||||
color_profile->cd_profile_id = g_strdup_printf ("icc-%s", checksum);
|
||||
color_profile->cd_profile = g_object_ref (cd_profile);
|
||||
|
||||
color_profile->notify_ready_id = g_idle_add (notify_ready_idle,
|
||||
color_profile);
|
||||
color_profile->notify_ready_id = g_idle_add_once (notify_ready_idle,
|
||||
color_profile);
|
||||
|
||||
return color_profile;
|
||||
}
|
||||
|
@ -1965,15 +1965,13 @@ meta_monitor_manager_get_display_configuration_timeout (MetaMonitorManager *mana
|
||||
return DEFAULT_DISPLAY_CONFIGURATION_TIMEOUT;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
save_config_timeout (gpointer user_data)
|
||||
{
|
||||
MetaMonitorManager *manager = user_data;
|
||||
|
||||
restore_previous_config (manager);
|
||||
manager->persistent_timeout_id = 0;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1982,9 +1980,9 @@ request_persistent_confirmation (MetaMonitorManager *manager)
|
||||
int timeout_s;
|
||||
|
||||
timeout_s = meta_monitor_manager_get_display_configuration_timeout (manager);
|
||||
manager->persistent_timeout_id = g_timeout_add_seconds (timeout_s,
|
||||
save_config_timeout,
|
||||
manager);
|
||||
manager->persistent_timeout_id = g_timeout_add_seconds_once (timeout_s,
|
||||
save_config_timeout,
|
||||
manager);
|
||||
g_source_set_name_by_id (manager->persistent_timeout_id,
|
||||
"[mutter] save_config_timeout");
|
||||
|
||||
|
@ -165,15 +165,13 @@ sync_state (MetaOrientationManager *self)
|
||||
g_signal_emit (self, signals[ORIENTATION_CHANGED], 0);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
changed_idle (gpointer user_data)
|
||||
{
|
||||
MetaOrientationManager *self = user_data;
|
||||
|
||||
self->sync_idle_id = 0;
|
||||
sync_state (self);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -188,7 +186,7 @@ queue_sync_state (MetaOrientationManager *self)
|
||||
if (self->sync_idle_id)
|
||||
return;
|
||||
|
||||
self->sync_idle_id = g_idle_add (changed_idle, self);
|
||||
self->sync_idle_id = g_idle_add_once (changed_idle, self);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1409,7 +1409,7 @@ meta_remote_desktop_session_cancel_transfer_requests (MetaRemoteDesktopSession *
|
||||
session);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
transfer_request_cleanup_timeout (gpointer user_data)
|
||||
{
|
||||
MetaRemoteDesktopSession *session = user_data;
|
||||
@ -1423,7 +1423,6 @@ transfer_request_cleanup_timeout (gpointer user_data)
|
||||
meta_remote_desktop_session_cancel_transfer_requests (session);
|
||||
|
||||
session->transfer_request_timeout_id = 0;
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1558,9 +1557,9 @@ reset_transfer_cleanup_timeout (MetaRemoteDesktopSession *session)
|
||||
{
|
||||
g_clear_handle_id (&session->transfer_request_timeout_id, g_source_remove);
|
||||
session->transfer_request_timeout_id =
|
||||
g_timeout_add (TRANSFER_REQUEST_CLEANUP_TIMEOUT_MS,
|
||||
transfer_request_cleanup_timeout,
|
||||
session);
|
||||
g_timeout_add_once (TRANSFER_REQUEST_CLEANUP_TIMEOUT_MS,
|
||||
transfer_request_cleanup_timeout,
|
||||
session);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -240,7 +240,7 @@ uninhibit_hw_cursor (MetaScreenCastAreaStreamSrc *area_src)
|
||||
area_src->hw_cursor_inhibited = FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
maybe_record_frame_on_idle (gpointer user_data)
|
||||
{
|
||||
MetaScreenCastAreaStreamSrc *area_src =
|
||||
@ -256,8 +256,6 @@ maybe_record_frame_on_idle (gpointer user_data)
|
||||
meta_screen_cast_stream_src_maybe_record_frame (src, flags,
|
||||
paint_phase,
|
||||
NULL);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -277,7 +275,7 @@ before_stage_painted (MetaStage *stage,
|
||||
if (!clutter_stage_view_peek_scanout (view))
|
||||
return;
|
||||
|
||||
area_src->maybe_record_idle_id = g_idle_add (maybe_record_frame_on_idle, src);
|
||||
area_src->maybe_record_idle_id = g_idle_add_once (maybe_record_frame_on_idle, src);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -311,7 +309,7 @@ stage_painted (MetaStage *stage,
|
||||
}
|
||||
}
|
||||
|
||||
area_src->maybe_record_idle_id = g_idle_add (maybe_record_frame_on_idle, src);
|
||||
area_src->maybe_record_idle_id = g_idle_add_once (maybe_record_frame_on_idle, src);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -136,7 +136,7 @@ meta_screen_cast_monitor_stream_src_get_specs (MetaScreenCastStreamSrc *src,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
maybe_record_frame_on_idle (gpointer user_data)
|
||||
{
|
||||
MetaScreenCastMonitorStreamSrc *monitor_src =
|
||||
@ -150,8 +150,6 @@ maybe_record_frame_on_idle (gpointer user_data)
|
||||
flags = META_SCREEN_CAST_RECORD_FLAG_NONE;
|
||||
paint_phase = META_SCREEN_CAST_PAINT_PHASE_DETACHED;
|
||||
meta_screen_cast_stream_src_maybe_record_frame (src, flags, paint_phase, NULL);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -190,8 +188,8 @@ stage_painted (MetaStage *stage,
|
||||
|
||||
if (!(record_result & META_SCREEN_CAST_RECORD_RESULT_RECORDED_FRAME))
|
||||
{
|
||||
monitor_src->maybe_record_idle_id = g_idle_add (maybe_record_frame_on_idle,
|
||||
src);
|
||||
monitor_src->maybe_record_idle_id = g_idle_add_once (maybe_record_frame_on_idle,
|
||||
src);
|
||||
g_source_set_name_by_id (monitor_src->maybe_record_idle_id,
|
||||
"[mutter] maybe_record_frame_on_idle [monitor-src]");
|
||||
}
|
||||
|
@ -759,7 +759,7 @@ meta_screen_cast_stream_src_pending_follow_up_frame (MetaScreenCastStreamSrc *sr
|
||||
return priv->follow_up_frame_source_id != 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
follow_up_frame_cb (gpointer user_data)
|
||||
{
|
||||
MetaScreenCastStreamSrc *src = user_data;
|
||||
@ -768,8 +768,6 @@ follow_up_frame_cb (gpointer user_data)
|
||||
|
||||
priv->follow_up_frame_source_id = 0;
|
||||
meta_screen_cast_stream_src_record_follow_up (src);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -782,9 +780,9 @@ maybe_schedule_follow_up_frame (MetaScreenCastStreamSrc *src,
|
||||
if (priv->follow_up_frame_source_id)
|
||||
return;
|
||||
|
||||
priv->follow_up_frame_source_id = g_timeout_add (us2ms (timeout_us),
|
||||
follow_up_frame_cb,
|
||||
src);
|
||||
priv->follow_up_frame_source_id = g_timeout_add_once (us2ms (timeout_us),
|
||||
follow_up_frame_cb,
|
||||
src);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -242,7 +242,7 @@ meta_cursor_renderer_native_prepare_frame (MetaCursorRendererNative *cursor_rend
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
meta_cursor_renderer_native_update_animation (MetaCursorRendererNative *native)
|
||||
{
|
||||
MetaCursorRendererNativePrivate *priv =
|
||||
@ -253,8 +253,6 @@ meta_cursor_renderer_native_update_animation (MetaCursorRendererNative *native)
|
||||
priv->animation_timeout_id = 0;
|
||||
meta_cursor_sprite_tick_frame (cursor_sprite);
|
||||
meta_cursor_renderer_force_update (renderer);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -279,9 +277,9 @@ maybe_schedule_cursor_sprite_animation_frame (MetaCursorRendererNative *native,
|
||||
return;
|
||||
|
||||
priv->animation_timeout_id =
|
||||
g_timeout_add (delay,
|
||||
(GSourceFunc) meta_cursor_renderer_native_update_animation,
|
||||
native);
|
||||
g_timeout_add_once (delay,
|
||||
(GSourceOnceFunc) meta_cursor_renderer_native_update_animation,
|
||||
native);
|
||||
g_source_set_name_by_id (priv->animation_timeout_id,
|
||||
"[mutter] meta_cursor_renderer_native_update_animation");
|
||||
}
|
||||
|
@ -557,7 +557,7 @@ allocate_virtual_monitor_id (MetaMonitorManagerNative *manager_native)
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
rebuild_virtual_idle_cb (gpointer user_data)
|
||||
{
|
||||
MetaMonitorManager *manager = user_data;
|
||||
@ -569,8 +569,6 @@ rebuild_virtual_idle_cb (gpointer user_data)
|
||||
priv->rebuild_virtual_idle_id = 0;
|
||||
|
||||
meta_monitor_manager_reconfigure (manager);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -586,7 +584,7 @@ on_virtual_monitor_mode_changed (MetaVirtualMonitor *virtual_monitor,
|
||||
if (priv->rebuild_virtual_idle_id)
|
||||
return;
|
||||
|
||||
priv->rebuild_virtual_idle_id = g_idle_add (rebuild_virtual_idle_cb, manager);
|
||||
priv->rebuild_virtual_idle_id = g_idle_add_once (rebuild_virtual_idle_cb, manager);
|
||||
}
|
||||
|
||||
static MetaVirtualMonitor *
|
||||
|
@ -743,7 +743,7 @@ configure_disabled_crtcs (MetaKmsDevice *kms_device,
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
dummy_power_save_page_flip_cb (gpointer user_data)
|
||||
{
|
||||
MetaRendererNative *renderer_native = user_data;
|
||||
@ -754,8 +754,6 @@ dummy_power_save_page_flip_cb (gpointer user_data)
|
||||
g_clear_list (&renderer_native->power_save_page_flip_onscreens,
|
||||
g_object_unref);
|
||||
renderer_native->power_save_page_flip_source_id = 0;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
void
|
||||
@ -767,9 +765,9 @@ meta_renderer_native_queue_power_save_page_flip (MetaRendererNative *renderer_na
|
||||
if (!renderer_native->power_save_page_flip_source_id)
|
||||
{
|
||||
renderer_native->power_save_page_flip_source_id =
|
||||
g_timeout_add (timeout_ms,
|
||||
dummy_power_save_page_flip_cb,
|
||||
renderer_native);
|
||||
g_timeout_add_once (timeout_ms,
|
||||
dummy_power_save_page_flip_cb,
|
||||
renderer_native);
|
||||
}
|
||||
|
||||
renderer_native->power_save_page_flip_onscreens =
|
||||
@ -823,15 +821,13 @@ free_unused_gpu_datas (MetaRendererNative *renderer_native)
|
||||
used_gpus);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
release_unused_gpus_idle (gpointer user_data)
|
||||
{
|
||||
MetaRendererNative *renderer_native = META_RENDERER_NATIVE (user_data);
|
||||
|
||||
renderer_native->release_unused_gpus_idle_id = 0;
|
||||
free_unused_gpu_datas (renderer_native);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -846,7 +842,7 @@ old_onscreen_freed (gpointer user_data,
|
||||
if (!renderer_native->release_unused_gpus_idle_id)
|
||||
{
|
||||
renderer_native->release_unused_gpus_idle_id =
|
||||
g_idle_add (release_unused_gpus_idle, renderer_native);
|
||||
g_idle_add_once (release_unused_gpus_idle, renderer_native);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -452,14 +452,12 @@ meta_input_device_x11_query_pointer_location (MetaInputDeviceX11 *device_xi2)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
clear_inhibit_pointer_query_cb (gpointer data)
|
||||
{
|
||||
MetaInputDeviceX11 *device_xi2 = META_INPUT_DEVICE_X11 (data);
|
||||
|
||||
device_xi2->inhibit_pointer_query_timer = 0;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
@ -480,7 +478,7 @@ meta_input_device_x11_get_pointer_location (ClutterInputDevice *device,
|
||||
device_xi2->query_status =
|
||||
meta_input_device_x11_query_pointer_location (device_xi2);
|
||||
device_xi2->inhibit_pointer_query_timer =
|
||||
g_idle_add (clear_inhibit_pointer_query_cb, device_xi2);
|
||||
g_idle_add_once (clear_inhibit_pointer_query_cb, device_xi2);
|
||||
}
|
||||
|
||||
*x = device_xi2->current_x;
|
||||
|
@ -569,14 +569,12 @@ handle_wm_protocols_event (MetaStageX11 *stage_x11,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
clipped_redraws_cool_off_cb (void *data)
|
||||
{
|
||||
MetaStageX11 *stage_x11 = data;
|
||||
|
||||
stage_x11->clipped_redraws_cool_off = 0;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
void
|
||||
@ -665,9 +663,9 @@ meta_stage_x11_handle_event (MetaStageX11 *stage_x11,
|
||||
g_source_remove);
|
||||
|
||||
stage_x11->clipped_redraws_cool_off =
|
||||
g_timeout_add (1000,
|
||||
clipped_redraws_cool_off_cb,
|
||||
stage_x11);
|
||||
g_timeout_add_once (1000,
|
||||
clipped_redraws_cool_off_cb,
|
||||
stage_x11);
|
||||
|
||||
/* Queue a relayout - we want glViewport to be called
|
||||
* with the correct values, and this is done in ClutterStage
|
||||
|
@ -172,7 +172,7 @@ meta_gesture_tracker_class_init (MetaGestureTrackerClass *klass)
|
||||
G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_UINT);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
autodeny_sequence (gpointer user_data)
|
||||
{
|
||||
MetaSequenceInfo *info = user_data;
|
||||
@ -183,7 +183,6 @@ autodeny_sequence (gpointer user_data)
|
||||
META_SEQUENCE_REJECTED);
|
||||
|
||||
info->autodeny_timeout_id = 0;
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static MetaSequenceInfo *
|
||||
@ -201,7 +200,7 @@ meta_sequence_info_new (MetaGestureTracker *tracker,
|
||||
info->tracker = tracker;
|
||||
info->sequence = clutter_event_get_event_sequence (event);
|
||||
info->state = META_SEQUENCE_NONE;
|
||||
info->autodeny_timeout_id = g_timeout_add (ms, autodeny_sequence, info);
|
||||
info->autodeny_timeout_id = g_timeout_add_once (ms, autodeny_sequence, info);
|
||||
|
||||
clutter_event_get_coords (event, &info->start_x, &info->start_y);
|
||||
|
||||
@ -328,12 +327,11 @@ gesture_cancel_cb (ClutterGestureAction *gesture,
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
cancel_and_unref_gesture_cb (ClutterGestureAction *action)
|
||||
{
|
||||
clutter_gesture_action_cancel (action);
|
||||
g_object_unref (action);
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -344,7 +342,7 @@ clear_gesture_data (GestureActionData *data)
|
||||
g_clear_signal_handler (&data->gesture_cancel_id, data->gesture);
|
||||
|
||||
/* Defer cancellation to an idle, as it may happen within event handling */
|
||||
g_idle_add ((GSourceFunc) cancel_and_unref_gesture_cb, data->gesture);
|
||||
g_idle_add_once ((GSourceOnceFunc) cancel_and_unref_gesture_cb, data->gesture);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -159,15 +159,13 @@ meta_startup_notification_update_cursor (MetaStartupNotification *sn)
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
meta_startup_notification_cursor_timeout (gpointer user_data)
|
||||
{
|
||||
MetaStartupNotification *sn = user_data;
|
||||
|
||||
meta_startup_notification_update_cursor (sn);
|
||||
sn->update_cursor_timeout_id = 0;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -178,9 +176,9 @@ meta_startup_notification_update_feedback (MetaStartupNotification *sn)
|
||||
|
||||
meta_startup_notification_update_cursor (sn);
|
||||
sn->update_cursor_timeout_id =
|
||||
g_timeout_add (UPDATE_CURSOR_TIMEOUT_MS,
|
||||
meta_startup_notification_cursor_timeout,
|
||||
sn);
|
||||
g_timeout_add_once (UPDATE_CURSOR_TIMEOUT_MS,
|
||||
meta_startup_notification_cursor_timeout,
|
||||
sn);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2139,7 +2139,7 @@ meta_window_force_placement (MetaWindow *window,
|
||||
window->placed = TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
enter_suspend_state_cb (gpointer user_data)
|
||||
{
|
||||
MetaWindow *window = META_WINDOW (user_data);
|
||||
@ -2147,13 +2147,10 @@ enter_suspend_state_cb (gpointer user_data)
|
||||
|
||||
priv->suspend_timoeut_id = 0;
|
||||
|
||||
g_return_val_if_fail (priv->suspend_state == META_WINDOW_SUSPEND_STATE_HIDDEN,
|
||||
G_SOURCE_REMOVE);
|
||||
g_return_if_fail (priv->suspend_state == META_WINDOW_SUSPEND_STATE_HIDDEN);
|
||||
|
||||
priv->suspend_state = META_WINDOW_SUSPEND_STATE_SUSPENDED;
|
||||
g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_SUSPEND_STATE]);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -2164,9 +2161,9 @@ set_hidden_suspended_state (MetaWindow *window)
|
||||
priv->suspend_state = META_WINDOW_SUSPEND_STATE_HIDDEN;
|
||||
g_return_if_fail (!priv->suspend_timoeut_id);
|
||||
priv->suspend_timoeut_id =
|
||||
g_timeout_add_seconds (SUSPEND_HIDDEN_TIMEOUT_S,
|
||||
enter_suspend_state_cb,
|
||||
window);
|
||||
g_timeout_add_seconds_once (SUSPEND_HIDDEN_TIMEOUT_S,
|
||||
enter_suspend_state_cb,
|
||||
window);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -7657,13 +7654,11 @@ meta_window_get_client_type (MetaWindow *window)
|
||||
return window->client_type;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
meta_window_close_dialog_timeout (MetaWindow *window)
|
||||
{
|
||||
meta_window_show_close_dialog (window);
|
||||
window->close_dialog_timeout_id = 0;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
void
|
||||
@ -7679,9 +7674,9 @@ meta_window_ensure_close_dialog_timeout (MetaWindow *window)
|
||||
return;
|
||||
|
||||
window->close_dialog_timeout_id =
|
||||
g_timeout_add (check_alive_timeout,
|
||||
(GSourceFunc) meta_window_close_dialog_timeout,
|
||||
window);
|
||||
g_timeout_add_once (check_alive_timeout,
|
||||
(GSourceOnceFunc) meta_window_close_dialog_timeout,
|
||||
window);
|
||||
g_source_set_name_by_id (window->close_dialog_timeout_id,
|
||||
"[mutter] meta_window_close_dialog_timeout");
|
||||
}
|
||||
|
@ -514,11 +514,10 @@ make_output_inert (gpointer key,
|
||||
make_output_resources_inert (wayland_output);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
delayed_destroy_outputs (gpointer data)
|
||||
{
|
||||
g_hash_table_destroy (data);
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static GHashTable *
|
||||
@ -560,7 +559,7 @@ meta_wayland_compositor_update_outputs (MetaWaylandCompositor *compositor,
|
||||
if (compositor->outputs)
|
||||
{
|
||||
g_hash_table_foreach (compositor->outputs, make_output_inert, NULL);
|
||||
g_timeout_add_seconds (10, delayed_destroy_outputs, compositor->outputs);
|
||||
g_timeout_add_seconds_once (10, delayed_destroy_outputs, compositor->outputs);
|
||||
}
|
||||
|
||||
return new_table;
|
||||
|
@ -1195,7 +1195,7 @@ process_selection_request (MetaX11Display *x11_display,
|
||||
meta_verbose ("Handled selection request");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
close_display_idle_cb (gpointer user_data)
|
||||
{
|
||||
MetaX11Display *x11_display = META_X11_DISPLAY (user_data);
|
||||
@ -1206,8 +1206,6 @@ close_display_idle_cb (gpointer user_data)
|
||||
x11_display->xselectionclear_timestamp);
|
||||
x11_display->display_close_idle = 0;
|
||||
meta_context_terminate (context);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -1239,7 +1237,7 @@ process_selection_clear (MetaX11Display *x11_display,
|
||||
if (!x11_display->display_close_idle)
|
||||
{
|
||||
x11_display->xselectionclear_timestamp = event->xselectionclear.time;
|
||||
x11_display->display_close_idle = g_idle_add (close_display_idle_cb, x11_display);
|
||||
x11_display->display_close_idle = g_idle_add_once (close_display_idle_cb, x11_display);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -185,7 +185,7 @@ meta_sync_counter_has_sync_alarm (MetaSyncCounter *sync_counter)
|
||||
sync_counter->sync_request_alarm != None);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
sync_request_timeout (gpointer data)
|
||||
{
|
||||
MetaSyncCounter *sync_counter = data;
|
||||
@ -212,8 +212,6 @@ sync_request_timeout (gpointer data)
|
||||
window == meta_window_drag_get_window (window_drag) &&
|
||||
meta_grab_op_is_resizing (meta_window_drag_get_grab_op (window_drag)))
|
||||
meta_window_x11_check_update_resize (window);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
void
|
||||
@ -266,9 +264,9 @@ meta_sync_counter_send_request (MetaSyncCounter *sync_counter)
|
||||
* if this time expires, we consider the window unresponsive
|
||||
* and resize it unsynchonized.
|
||||
*/
|
||||
sync_counter->sync_request_timeout_id = g_timeout_add (1000,
|
||||
sync_request_timeout,
|
||||
sync_counter);
|
||||
sync_counter->sync_request_timeout_id = g_timeout_add_once (1000,
|
||||
sync_request_timeout,
|
||||
sync_counter);
|
||||
g_source_set_name_by_id (sync_counter->sync_request_timeout_id,
|
||||
"[mutter] sync_request_timeout");
|
||||
|
||||
|
@ -346,7 +346,7 @@ source_new_cb (GObject *object,
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
unset_clipboard_owner (gpointer user_data)
|
||||
{
|
||||
MetaX11Display *x11_display = user_data;
|
||||
@ -358,8 +358,6 @@ unset_clipboard_owner (gpointer user_data)
|
||||
g_clear_object (&x11_display->selection.owners[META_SELECTION_CLIPBOARD]);
|
||||
|
||||
x11_display->selection.timeout_id = 0;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -409,9 +407,9 @@ meta_x11_selection_handle_xfixes_selection_notify (MetaX11Display *x11_display,
|
||||
* selection. Restoring the clipboard in this case would overwrite the
|
||||
* new selection, so this will be cancelled when a new selection
|
||||
* arrives. */
|
||||
x11_display->selection.timeout_id = g_timeout_add (10,
|
||||
unset_clipboard_owner,
|
||||
x11_display);
|
||||
x11_display->selection.timeout_id = g_timeout_add_once (10,
|
||||
unset_clipboard_owner,
|
||||
x11_display);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -976,7 +976,7 @@ focus_window_delayed_unmanaged (gpointer user_data)
|
||||
meta_window_x11_delayed_focus_data_free (data);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
focus_window_delayed_timeout (gpointer user_data)
|
||||
{
|
||||
MetaWindowX11DelayedFocusData *data = user_data;
|
||||
@ -990,8 +990,6 @@ focus_window_delayed_timeout (gpointer user_data)
|
||||
meta_window_x11_delayed_focus_data_free (data);
|
||||
|
||||
meta_window_focus (window, timestamp);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1019,8 +1017,8 @@ meta_window_x11_maybe_focus_delayed (MetaWindow *window,
|
||||
G_CALLBACK (meta_window_x11_delayed_focus_data_free),
|
||||
data);
|
||||
|
||||
data->timeout_id = g_timeout_add (TAKE_FOCUS_FALLBACK_DELAY_MS,
|
||||
focus_window_delayed_timeout, data);
|
||||
data->timeout_id = g_timeout_add_once (TAKE_FOCUS_FALLBACK_DELAY_MS,
|
||||
focus_window_delayed_timeout, data);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
x
Reference in New Issue
Block a user