]> Dogcows Code - chaz/openbox/blobdiff - src/openbox.cc
add/lower work
[chaz/openbox] / src / openbox.cc
index 655fe0d53bd7a3d0e43fbd7d8b5b90885d3b7a67..4d2f102479c266d781d580d2d24f9fb657e440cd 100644 (file)
@@ -326,5 +326,26 @@ void Openbox::setFocusedClient(OBClient *c)
   }
 }
 
+void Openbox::execute(int screen, const std::string &bin)
+{
+#ifdef    __EMX__
+  // XXX: whats this for? windows?
+  spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", bin.c_str(), NULL);
+#else //  __EMX__
+  if (screen >= ScreenCount(otk::OBDisplay::display))
+    screen = 0;
+  const std::string &dstr =
+    otk::OBDisplay::screenInfo(screen)->displayString();
+  
+  if (! fork()) {
+      setsid();
+      int ret = putenv(const_cast<char *>(dstr.c_str()));
+      assert(ret != -1);
+      ret = execl("/bin/sh", "/bin/sh", "-c", bin.c_str(), NULL);
+      exit(ret);
+    }
+#endif // __EMX__
+}
+
 }
 
This page took 0.01991 seconds and 4 git commands to generate.