Openbox::instance->bindings()->grabButtons(true, client);
- if (shown) {
- // XXX: make this optional or more intelligent
- if (client->normal())
- client->focus();
- }
-
// call the python NEWWINDOW binding
EventData *data = new_event_data(_number, window, EventNewWindow, 0);
Openbox::instance->bindings()->fireEvent(data);
// remove from the stacking order
_stacking.remove(client);
-
- // pass around focus if this window was focused XXX do this better!
- if (Openbox::instance->focusedClient() == client) {
- OBClient *newfocus = 0;
- OBClient::List::iterator it, end = _stacking.end();
- for (it = _stacking.begin(); it != end; ++it)
- if ((*it)->desktop() == _desktop && (*it)->normal() && (*it)->focus()) {
- newfocus = *it;
- break;
- }
- if (!newfocus)
- client->unfocus();
- }
+
+ // unfocus the client
+ client->unfocus();
// remove from the wm's map
Openbox::instance->removeClient(client->window());
_desktop);
if (old == _desktop) return;
-
+
OBClient::List::iterator it, end = clients.end();
for (it = clients.begin(); it != end; ++it) {
if ((*it)->desktop() == old) {
(*it)->frame->show();
}
}
+
+ // force the callbacks to fire
+ Openbox::instance->setFocusedClient(0);
}
void OBScreen::changeNumDesktops(long num)