+ /*
+ NOTE: we dont use _clients[] to find the value because that will insert
+ a new null into the hash, which really sucks when we want to clean up the
+ hash at shutdown!
+ */
+ ClientMap::iterator it = _clients.find(window);
+ if (it != _clients.end())
+ return it->second;
+ else
+ return (OBClient*) 0;
+}
+
+
+void Openbox::setFocusedClient(OBClient *c)
+{
+ _focused_client = c;
+ if (c) {
+ _focused_screen = _screens[c->screen()];
+ } else {
+ assert(_focused_screen);
+ XSetInputFocus(otk::OBDisplay::display, _focused_screen->focuswindow(),
+ RevertToNone, CurrentTime);
+ }
+}
+
+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__