[gnome-boxes] Use transitions-complete signal instead of timeout



commit bc94e4d648d0d57f91ff8bfdac199dfb66c3f701
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Jun 7 19:56:04 2012 +0200

    Use transitions-complete signal instead of timeout
    
    This is much nicer. Also remove comment about this.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677274

 src/machine.vala |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/src/machine.vala b/src/machine.vala
index b6b5fd4..3c50bf5 100644
--- a/src/machine.vala
+++ b/src/machine.vala
@@ -386,17 +386,15 @@ private class Boxes.MachineActor: Boxes.UI {
                                                        Clutter.BinAlignment.FILL,
                                                        Clutter.BinAlignment.FILL);
 
-                    /* Todo: No good way to get the end of the transision yet? */
-                    Timeout.add (App.app.duration, () => {
-                            var widget = display.contents;
-                            display.contents = null;
-                            display.destroy ();
-                            display = null;
-                            // FIXME: enable grabs
-                            machine.display.set_enable_inputs (widget, true);
-                            App.app.display_page.show_display (machine.display, widget);
-                            return false;
-                        });
+                    display.transitions_completed.connect (() => {
+                        var widget = display.contents;
+                        display.contents = null;
+                        display.destroy ();
+                        display = null;
+                        // FIXME: enable grabs
+                        machine.display.set_enable_inputs (widget, true);
+                        App.app.display_page.show_display (machine.display, widget);
+                    });
                 } else
                     App.app.display_page.show ();
             }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]