[gnome-boxes] Exit to collection view if the VM goes to a non-running state



commit 0ed0307427559ec4b27ecc7139b41e3abfc1051b
Author: Alexander Larsson <alexl redhat com>
Date:   Tue Nov 20 12:24:31 2012 +0100

    Exit to collection view if the VM goes to a non-running state
    
    This is required for instance for the SLEEP and PAUSE mode, as
    in these modes we can't use the spice display widget, but the
    spice connection is not disconnected, so we don't currrently
    exit to the collection view due to that.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=688717

 src/machine.vala |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/machine.vala b/src/machine.vala
index bace623..9476593 100644
--- a/src/machine.vala
+++ b/src/machine.vala
@@ -55,6 +55,16 @@ private abstract class Boxes.Machine: Boxes.CollectionItem, Boxes.IPropertiesPro
                 if (orig_pixbuf != null)
                     pixbuf = draw_vm (orig_pixbuf, SCREENSHOT_WIDTH, SCREENSHOT_HEIGHT);
             }
+
+            // If the display is active and the VM goes to a non-running
+            // state, we got to exit, as there is no way for the user
+            // to progress in the vm display anymore
+            if (display != null && !stay_on_display &&
+                App.app.current_item == this &&
+                value != MachineState.RUNNING &&
+                value != MachineState.UNKNOWN) {
+                App.app.ui_state = Boxes.UIState.COLLECTION;
+            }
         }
     }
 



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