mirror of
https://github.com/elementary/gala.git
synced 2024-11-24 04:21:04 +03:00
Use MT-safe Clutter.Threads.Timeout.add () instead of GLib.Timeout.add ()
This commit is contained in:
parent
9b78a00cbe
commit
1021be483e
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
});
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user