X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fscreen.cc;h=d7cea02481150041f944d0e00469d1ec136e8d0e;hb=cc39863363f6c424a1d5f3790ef182b52b69a53e;hp=d9067aa05f9e789e7470545f4f556d3ad5ff71fb;hpb=056ff3b50cddd39b6f45969c17611dc3bf396ae9;p=chaz%2Fopenbox diff --git a/src/screen.cc b/src/screen.cc index d9067aa0..d7cea024 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -196,7 +196,7 @@ void OBScreen::updateStrut() { _strut.left = _strut.right = _strut.top = _strut.bottom = 0; - ClientList::iterator it, end = clients.end(); + OBClient::List::iterator it, end = clients.end(); for (it = clients.begin(); it != end; ++it) { const otk::Strut &s = (*it)->strut(); _strut.left = std::max(_strut.left, s.left); @@ -364,8 +364,8 @@ void OBScreen::setClientList() windows = new Window[size]; win_it = windows; - ClientList::const_iterator it = clients.begin(); - const ClientList::const_iterator end = clients.end(); + OBClient::List::const_iterator it = clients.begin(); + const OBClient::List::const_iterator end = clients.end(); for (; it != end; ++it, ++win_it) *win_it = (*it)->window(); } else @@ -397,8 +397,8 @@ void OBScreen::setStackingList() windows = new Window[size]; win_it = windows; - ClientList::const_iterator it = _stacking.begin(); - const ClientList::const_iterator end = _stacking.end(); + OBClient::List::const_iterator it = _stacking.begin(); + const OBClient::List::const_iterator end = _stacking.end(); for (; it != end; ++it, ++win_it) *win_it = (*it)->window(); } else @@ -520,7 +520,15 @@ void OBScreen::manageWindow(Window window) Openbox::instance->bindings()->grabButtons(true, client); // XXX: make this optional or more intelligent - client->focus(); + if (client->normal()) + client->focus(); + + // call the python NEWWINDOW binding + EventData *data = new_event_data(window, EventNewWindow, 0); + Openbox::instance->bindings()->fireEvent(data); + Py_DECREF((PyObject*)data); + + printf("Managed window 0x%lx\n", window); } @@ -528,6 +536,11 @@ void OBScreen::unmanageWindow(OBClient *client) { OBFrame *frame = client->frame; + // call the python CLOSEWINDOW binding + EventData *data = new_event_data(client->window(), EventCloseWindow, 0); + Openbox::instance->bindings()->fireEvent(data); + Py_DECREF((PyObject*)data); + Openbox::instance->bindings()->grabButtons(false, client); // remove from the stacking order @@ -536,7 +549,7 @@ void OBScreen::unmanageWindow(OBClient *client) // pass around focus if this window was focused XXX do this better! if (Openbox::instance->focusedClient() == client) { OBClient *newfocus = 0; - ClientList::iterator it, end = _stacking.end(); + OBClient::List::iterator it, end = _stacking.end(); for (it = _stacking.begin(); it != end; ++it) if ((*it)->normal() && (*it)->focus()) { newfocus = *it; @@ -593,7 +606,7 @@ void OBScreen::restack(bool raise, OBClient *client) // the stacking list is from highest to lowest - ClientList::iterator it = _stacking.begin(), end = _stacking.end(); + OBClient::List::iterator it = _stacking.begin(), end = _stacking.end(); // insert the windows above this window for (; it != end; ++it) { if ((*it)->layer() < layer || (raise && (*it)->layer() == layer))