[gnome-nibbles] Simplify main stack transitions



commit 8a3582d29d9172438f3e3f604e3363c31c5d06d8
Author: Iulian Radu <iulian radu67 gmail com>
Date:   Mon Aug 15 12:22:04 2016 +0300

    Simplify main stack transitions
    
    Also, on Wayland, the game frame is displayed on top of the window.
    This seems to be a problem with GtkStack transitions.
    
    This committ fixes the problem by disabling the transition when
    displaying the game frame.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763603

 src/gnome-nibbles.vala |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/gnome-nibbles.vala b/src/gnome-nibbles.vala
index ffcf526..c57a027 100644
--- a/src/gnome-nibbles.vala
+++ b/src/gnome-nibbles.vala
@@ -544,10 +544,9 @@ public class Nibbles : Gtk.Application
         new_game_button.hide ();
         pause_button.hide ();
 
-        var type = main_stack.get_transition_type ();
         main_stack.set_transition_type (Gtk.StackTransitionType.NONE);
         main_stack.set_visible_child_name ("number_of_players");
-        main_stack.set_transition_type (type);
+        main_stack.set_transition_type (Gtk.StackTransitionType.SLIDE_UP);
 
         number_of_players_buttons[game.numhumans - 1].set_active (true);
         number_of_ai_buttons[game.numai].set_active (true);
@@ -606,6 +605,11 @@ public class Nibbles : Gtk.Application
 
     private void show_game_view ()
     {
+        /* FIXME: If there's a transition set, on Wayland, the ClutterEmbed
+         * will show outside the game's window. Don't change the transition
+         * type when that's no longer a problem.
+         */
+        main_stack.set_transition_type (Gtk.StackTransitionType.NONE);
         new_game_button.show ();
         pause_button.show ();
 
@@ -613,6 +617,8 @@ public class Nibbles : Gtk.Application
 
         headerbar.set_title (_("Level %d").printf (game.current_level));
         main_stack.set_visible_child_name ("game_box");
+
+        main_stack.set_transition_type (Gtk.StackTransitionType.SLIDE_UP);
     }
 
     private void back_cb ()


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