X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fblackbox.cc;h=631e819e1bab33c5c499efd112ca2e0739def576;hb=6d4aa1af4e6377602e051cccb881fbd357f34de7;hp=3cc12bc4523e65333d00e6ab719efd728d7b2114;hpb=f4c0547b7a90c9647a2c39c3d1a737142eab088e;p=chaz%2Fopenbox diff --git a/src/blackbox.cc b/src/blackbox.cc index 3cc12bc4..631e819e 100644 --- a/src/blackbox.cc +++ b/src/blackbox.cc @@ -145,6 +145,12 @@ Blackbox::Blackbox(char **m_argv, char *dpy_name, char *rc, char *menu) ::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); @@ -322,7 +328,12 @@ void Blackbox::process_event(XEvent *e) { BlackboxWindow *win = searchWindow(e->xmaprequest.window); - if (! win) { + if (win) { + if (win->isIconic()) { + win->deiconify(); + win->setInputFocus(); + } + } else { BScreen *screen = searchScreen(e->xmaprequest.parent); if (! screen) { @@ -444,13 +455,9 @@ void Blackbox::process_event(XEvent *e) { 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; } @@ -1143,6 +1150,7 @@ void Blackbox::restart(const char *prog) { shutdown(); if (prog) { + putenv(const_cast(screenList.front()->displayString().c_str())); execlp(prog, prog, NULL); perror(prog); }