::blackbox = this;
argv = m_argv;
+
+ // try to make sure the ~/.openbox directory exists
+ mkdir(expandTilde("~/.openbox").c_str(), S_IREAD | S_IWRITE | S_IEXEC |
+ S_IRGRP | S_IWGRP | S_IXGRP |
+ S_IROTH | S_IWOTH | S_IXOTH);
+
if (! rc) rc = "~/.openbox/rc";
rc_file = expandTilde(rc);
config.setFile(rc_file);
active_screen = 0;
focused_window = changing_window = (BlackboxWindow *) 0;
- XrmInitialize();
load_rc();
xatom = new XAtom(getXDisplay());
BlackboxWindow *win = searchWindow(e->xmaprequest.window);
- if (! win) {
+ if (win) {
+ bool focus = False;
+ if (win->isIconic()) {
+ win->deiconify();
+ focus = True;
+ }
+ if (win->isShaded()) {
+ win->shade();
+ focus = True;
+ }
+
+ if (focus && (win->isTransient() || win->getScreen()->doFocusNew()))
+ win->setInputFocus();
+ } else {
BScreen *screen = searchScreen(e->xmaprequest.parent);
if (! screen) {
case PropertyNotify: {
last_time = e->xproperty.time;
- if (e->xproperty.state != PropertyDelete) {
- BlackboxWindow *win = searchWindow(e->xproperty.window);
-
- if (win)
- win->propertyNotifyEvent(e->xproperty.atom);
- }
-
+ BlackboxWindow *win = searchWindow(e->xproperty.window);
+ if (win)
+ win->propertyNotifyEvent(&e->xproperty);
break;
}
if (win) {
if (win->isIconic())
win->deiconify(False, True);
+ if (win->isShaded())
+ win->shade();
if (win->isVisible() && win->setInputFocus()) {
- //win->getScreen()->getWorkspace(win->getWorkspaceNumber())->
- // raiseWindow(win);
+ win->getScreen()->getWorkspace(win->getWorkspaceNumber())->
+ raiseWindow(win);
win->installColormap(True);
}
}
bool Blackbox::handleSignal(int sig) {
switch (sig) {
case SIGHUP:
+ restart();
+ break;
+
case SIGUSR1:
reconfigure();
break;
shutdown();
if (prog) {
+ putenv(const_cast<char *>(screenList.front()->displayString().c_str()));
execlp(prog, prog, NULL);
perror(prog);
}
void Blackbox::load_rc(void) {
if (! config.load())
- config.create();
+ config.create();
string s;