Index: /trunk/doc/manual/en_US/SDKRef.xml
===================================================================
--- /trunk/doc/manual/en_US/SDKRef.xml	(revision 55254)
+++ /trunk/doc/manual/en_US/SDKRef.xml	(revision 55255)
@@ -3920,4 +3920,14 @@
           <xref linkend="MachineState__OnlineSnapshotting" xreflabel="MachineState::OnlineSnapshotting" />
           is used when an online snapshot is taken.</para>
+        </listitem>
+
+        <listitem>
+          <para>A new event has been introduced, which signals when a snapshot has been
+          restored:
+          <xref linkend="ISnapshotRestoredEvent" xreflabel="ISnapshotRestoredEvent"/>.
+          Previously the event
+          <xref linkend="ISnapshotDeletedEvent" xreflabel="ISnapshotDeletedEvent"/> was
+          signalled, which isn't logical (but could be distinguished from actual deletion
+          by the fact that the snapshot was still there).</para>
         </listitem>
 
Index: /trunk/include/VBox/log.h
===================================================================
--- /trunk/include/VBox/log.h	(revision 55254)
+++ /trunk/include/VBox/log.h	(revision 55255)
@@ -4,5 +4,5 @@
 
 /*
- * Copyright (C) 2006-2014 Oracle Corporation
+ * Copyright (C) 2006-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -563,4 +563,6 @@
     LOG_GROUP_MAIN_SNAPSHOTEVENT,
     /** Main group, ISnapshotTakenEvent. */
+    LOG_GROUP_MAIN_SNAPSHOTRESTOREDEVENT,
+    /** Main group, ISnapshotRestoredEvent. */
     LOG_GROUP_MAIN_SNAPSHOTTAKENEVENT,
     /** Main group, IStateChangedEvent. */
@@ -1026,4 +1028,5 @@
     "MAIN_SNAPSHOTDELETEDEVENT", \
     "MAIN_SNAPSHOTEVENT", \
+    "MAIN_SNAPSHOTRESTOREDEVENT", \
     "MAIN_SNAPSHOTTAKENEVENT", \
     "MAIN_STATECHANGEDEVENT", \
Index: /trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 55254)
+++ /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 55255)
@@ -20111,5 +20111,5 @@
   <enum
     name="VBoxEventType"
-    uuid="1622f8d2-6c76-4410-9e78-86e083046efc"
+    uuid="b2ddb312-2f9e-4e69-98df-7235e43b2149"
     >
 
@@ -20490,7 +20490,11 @@
       </desc>
     </const>
-    <!-- OnHostNameResolutionConfigurationChange -->
+    <const name="OnSnapshotRestored" value="95">
+      <desc>
+        See <link to="ISnapshotRestoredEvent">ISnapshotRestoredEvent</link>.
+      </desc>
+    </const>
     <!-- Last event marker -->
-    <const name="Last" value="95">
+    <const name="Last" value="96">
       <desc>
         Must be last event, used for iterations and structures relying on numerical event values.
@@ -20987,4 +20991,16 @@
       </note>
 
+      <see><link to="ISnapshot"/></see>
+    </desc>
+    <attribute name="midlDoesNotLikEmptyInterfaces" readonly="yes" type="boolean"/>
+  </interface>
+
+  <interface
+    name="ISnapshotRestoredEvent" extends="ISnapshotEvent"
+    uuid="f4d803b4-9b2d-4377-bfe6-9702e881516b"
+    wsmap="managed" autogen="VBoxEvent" id="OnSnapshotRestored"
+    >
+    <desc>
+      Snapshot of the given machine has been restored.
       <see><link to="ISnapshot"/></see>
     </desc>
Index: /trunk/src/VBox/Main/include/VirtualBoxImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/VirtualBoxImpl.h	(revision 55254)
+++ /trunk/src/VBox/Main/include/VirtualBoxImpl.h	(revision 55255)
@@ -141,4 +141,5 @@
     void i_onSnapshotTaken(const Guid &aMachineId, const Guid &aSnapshotId);
     void i_onSnapshotDeleted(const Guid &aMachineId, const Guid &aSnapshotId);
+    void i_onSnapshotRestored(const Guid &aMachineId, const Guid &aSnapshotId);
     void i_onSnapshotChange(const Guid &aMachineId, const Guid &aSnapshotId);
     void i_onGuestPropertyChange(const Guid &aMachineId, IN_BSTR aName, IN_BSTR aValue,
Index: /trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/SnapshotImpl.cpp	(revision 55254)
+++ /trunk/src/VBox/Main/src-server/SnapshotImpl.cpp	(revision 55255)
@@ -2173,5 +2173,4 @@
             i_setMachineState(MachineState_PoweredOff);
 
-        i_updateMachineStateOnClient();
         stateRestored = true;
 
@@ -2265,5 +2264,4 @@
             /* restore the machine state */
             i_setMachineState(task.m_machineStateBackup);
-            i_updateMachineStateOnClient();
         }
     }
@@ -2275,5 +2273,5 @@
 
     if (SUCCEEDED(rc))
-        mParent->i_onSnapshotDeleted(mData->mUuid, Guid());
+        mParent->i_onSnapshotRestored(mData->mUuid, Guid());
 
     LogFlowThisFunc(("Done restoring snapshot (rc=%08X)\n", rc));
@@ -2488,10 +2486,15 @@
     // set the proper machine state here now (note: after creating a Task instance)
     if (mData->mMachineState == MachineState_Running)
+    {
         i_setMachineState(MachineState_DeletingSnapshotOnline);
+        i_updateMachineStateOnClient();
+    }
     else if (mData->mMachineState == MachineState_Paused)
+    {
         i_setMachineState(MachineState_DeletingSnapshotPaused);
+        i_updateMachineStateOnClient();
+    }
     else
         i_setMachineState(MachineState_DeletingSnapshot);
-    i_updateMachineStateOnClient();
 
     /* return the progress to the caller */
@@ -3166,5 +3169,6 @@
         // task was started
         i_setMachineState(task.m_machineStateBackup);
-        i_updateMachineStateOnClient();
+        if (Global::IsOnline(mData->mMachineState))
+            i_updateMachineStateOnClient();
 
         mParent->i_saveModifiedRegistries();
Index: /trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp	(revision 55254)
+++ /trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp	(revision 55255)
@@ -2814,5 +2814,5 @@
 }
 
-/** Event for onSnapshotTaken(), onSnapshotDeleted() and onSnapshotChange() */
+/** Event for i_onSnapshotTaken(), i_onSnapshotDeleted(), i_onSnapshotRestored() and i_onSnapshotChange() */
 struct SnapshotEvent : public VirtualBox::CallbackEvent
 {
@@ -2839,5 +2839,5 @@
 {
     i_postEvent(new SnapshotEvent(this, aMachineId, aSnapshotId,
-                                VBoxEventType_OnSnapshotTaken));
+                                  VBoxEventType_OnSnapshotTaken));
 }
 
@@ -2848,5 +2848,5 @@
 {
     i_postEvent(new SnapshotEvent(this, aMachineId, aSnapshotId,
-                                VBoxEventType_OnSnapshotDeleted));
+                                  VBoxEventType_OnSnapshotDeleted));
 }
 
@@ -2854,8 +2854,17 @@
  *  @note Doesn't lock any object.
  */
+void VirtualBox::i_onSnapshotRestored(const Guid &aMachineId, const Guid &aSnapshotId)
+{
+    i_postEvent(new SnapshotEvent(this, aMachineId, aSnapshotId,
+                                  VBoxEventType_OnSnapshotRestored));
+}
+
+/**
+ *  @note Doesn't lock any object.
+ */
 void VirtualBox::i_onSnapshotChange(const Guid &aMachineId, const Guid &aSnapshotId)
 {
     i_postEvent(new SnapshotEvent(this, aMachineId, aSnapshotId,
-                                VBoxEventType_OnSnapshotChanged));
+                                  VBoxEventType_OnSnapshotChanged));
 }
 
