X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fblackbox.cc;h=dafc6bdfa8d8ce610008dfee93a13b12b3dcb177;hb=32c13697524e01a21e5b667188cad73434693ecb;hp=36828f7e5e3ce2927e24bebe5521c2a3731a0a49;hpb=351a06655bdd7d440780b5bc5b255081c888044b;p=chaz%2Fopenbox diff --git a/src/blackbox.cc b/src/blackbox.cc index 36828f7e..dafc6bdf 100644 --- a/src/blackbox.cc +++ b/src/blackbox.cc @@ -111,7 +111,6 @@ using std::string; #include "Workspace.hh" #include "Workspacemenu.hh" #include "XAtom.hh" -#include "Input.hh" // X event scanner for enter/leave notifies - adapted from twm struct scanargs { @@ -146,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); @@ -159,11 +164,9 @@ Blackbox::Blackbox(char **m_argv, char *dpy_name, char *rc, char *menu) active_screen = 0; focused_window = changing_window = (BlackboxWindow *) 0; - XrmInitialize(); load_rc(); xatom = new XAtom(getXDisplay()); - input = new BInput(this); cursor.session = XCreateFontCursor(getXDisplay(), XC_left_ptr); cursor.move = XCreateFontCursor(getXDisplay(), XC_fleur); @@ -324,7 +327,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) { @@ -446,13 +454,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; } @@ -1145,6 +1149,7 @@ void Blackbox::restart(const char *prog) { shutdown(); if (prog) { + putenv(const_cast(screenList.front()->displayString().c_str())); execlp(prog, prog, NULL); perror(prog); } @@ -1196,7 +1201,7 @@ void Blackbox::save_rc(void) { void Blackbox::load_rc(void) { if (! config.load()) - config.create(); + config.create(); string s;