exit LibCecTray when we detect that XBMC was started
[deb_libcec.git] / src / LibCecTray / controller / applications / internal / XBMCController.cs
index b2dfc20455973408970b258a79a136a0218c9663..fe15fd25edc18d3b62c2442ab9d3ce17b2433d4d 100644 (file)
@@ -56,6 +56,17 @@ namespace LibCECTray.controller.applications.@internal
       ControlApplication.Value = false;
 
       LoadXMLConfiguration();
+
+      ApplicationRunningChanged += RunningChanged;
+    }
+
+         static void RunningChanged(bool running)
+    {
+      if (running)
+      {
+        // XBMC is running, close the application, or we'll block communication
+        Application.Exit();
+      }
     }
 
     public override ApplicationAction DefaultValue(CecKeypress key)