[gnome-games] ui: Reset the display UI state before getting the runner



commit aeec625cbcee717356e4338c683e506d2702640b
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Fri Sep 16 10:08:25 2016 +0200

    ui: Reset the display UI state before getting the runner
    
    This avoids the display part of the UI to be in an inconsistent state if
    we couldn't get the game's runner.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771513

 src/ui/application-window.vala |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index 7154f47..8f3da0a 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -205,6 +205,14 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
                display_box.header_bar.game_title = game.name;
                ui_state = UiState.DISPLAY;
 
+               // Reset the UI parts depending on the runner to avoid an
+               // inconsistent state is case we couldn't retrieve it.
+               display_header_bar.can_fullscreen = false;
+               display_box.header_bar.can_fullscreen = false;
+               display_box.runner = null;
+               display_header_bar.media_set = null;
+               display_box.header_bar.media_set = null;
+
                var runner = try_get_runner (game);
                if (runner == null)
                        return;


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