Use MT-safe Clutter.Threads.Timeout.add () instead of GLib.Timeout.add ()

This commit is contained in:
Rico Tzschichholz 2013-11-27 19:50:56 +01:00
parent 9b78a00cbe
commit 1021be483e
7 changed files with 11 additions and 11 deletions

View File

@ -143,7 +143,7 @@ namespace Gala
if (interval > uint.MAX)
return;
update_animation_timeout_id = Timeout.add (interval, () => {
update_animation_timeout_id = Clutter.Threads.Timeout.add (interval, () => {
update_animation_timeout_id = 0;
update_animation.begin ();
return false;

View File

@ -691,7 +691,7 @@ namespace Gala
} else {
close (true);
//wait for the animation to finish before switching
Timeout.add (400, () => {
Clutter.Threads.Timeout.add (400, () => {
window.get_workspace ().activate_with_focus (window, screen.get_display ().get_current_time ());
return false;
});
@ -726,7 +726,7 @@ namespace Gala
#endif
if (animate) {
Timeout.add (300, () => {
Clutter.Threads.Timeout.add (300, () => {
visible = false;
ready = true;

View File

@ -261,7 +261,7 @@ namespace Gala
if (prev_window != current_window) {
dim_windows ();
// wait for the dimming to finish
Timeout.add (250, () => {
Clutter.Threads.Timeout.add (250, () => {
close (event.time);
return false;
});

View File

@ -88,7 +88,7 @@ namespace Gala
window.delete (window.get_screen ().get_display ().get_current_time ());
// see if the window is still alive after the animation ended. If it is, it's pretty certain that it
// popped up some kind of confirmation dialog, so we focus it
Timeout.add (AnimationSettings.get_default ().close_duration + WAIT_FOR_CONFIRMATION_DIALOG, () => {
Clutter.Threads.Timeout.add (AnimationSettings.get_default ().close_duration + WAIT_FOR_CONFIRMATION_DIALOG, () => {
if (clone != null && clone.source != null && !(clone.source as Meta.WindowActor).is_destroyed ()) {
clone.source.opacity = 255;
selected (window);

View File

@ -282,7 +282,7 @@ namespace Gala
window.delete (screen.get_display ().get_current_time ());
}
GLib.Timeout.add (250, () => {
Clutter.Threads.Timeout.add (250, () => {
//wait for confirmation dialogs to popup
if (Utils.get_n_windows (workspace) == 0) {
workspace.window_added.disconnect (handle_window_added);
@ -498,7 +498,7 @@ namespace Gala
return;
// we need to wait untill the animation ended, otherwise we get trouble with focus handling
Timeout.add (AnimationSettings.get_default ().workspace_switch_duration + 10, () => {
Clutter.Threads.Timeout.add (AnimationSettings.get_default ().workspace_switch_duration + 10, () => {
// check again, maybe something opened
if (workspace == null || Utils.get_n_windows (workspace) > 0)
return false;
@ -537,7 +537,7 @@ namespace Gala
workspace.activate (screen.get_display ().get_current_time ());
// wait for the animation to be finished before closing, for aesthetic reasons
Timeout.add (AnimationSettings.get_default ().workspace_switch_duration, () => {
Clutter.Threads.Timeout.add (AnimationSettings.get_default ().workspace_switch_duration, () => {
clicked ();
return false;
});
@ -563,7 +563,7 @@ namespace Gala
if (hover_timer > 0)
GLib.Source.remove (hover_timer);
hover_timer = Timeout.add (CLOSE_BUTTON_DELAY, () => {
hover_timer = Clutter.Threads.Timeout.add (CLOSE_BUTTON_DELAY, () => {
close_button.visible = true;
close_button.animate (AnimationMode.EASE_OUT_ELASTIC, 400, scale_x : 1.0f, scale_y : 1.0f);
return false;

View File

@ -447,7 +447,7 @@ namespace Gala
#endif
animating = true;
Timeout.add (50, () => {
Clutter.Threads.Timeout.add (50, () => {
animating = false;
return false;
}); //catch hot corner hiding problem

View File

@ -67,7 +67,7 @@ namespace Gala
wins.scale_center_x = mx;
wins.scale_center_y = my;
mouse_poll_timer = Timeout.add (MOUSE_POLL_TIME, () => {
mouse_poll_timer = Clutter.Threads.Timeout.add (MOUSE_POLL_TIME, () => {
client_pointer.get_position (null, out mx, out my);
if (wins.scale_center_x == mx && wins.scale_center_y == my)
return true;