Openbox::instance->addClient(client->frame->grip_left(), client);
Openbox::instance->addClient(client->frame->grip_right(), client);
- // XXX: if on the current desktop..
- client->frame->show();
+ bool shown = false;
+
+ // if on the current desktop.. (or all desktops)
+ if (client->desktop() == _desktop ||
+ client->desktop() == (signed)0xffffffff) {
+ shown = true;
+ client->frame->show();
+ }
// XXX: handle any requested states such as maximized
Openbox::instance->bindings()->grabButtons(true, client);
- // XXX: make this optional or more intelligent
- if (client->normal())
- client->focus();
+ if (shown) {
+ // XXX: make this optional or more intelligent
+ if (client->normal())
+ client->focus();
+ }
// call the python NEWWINDOW binding
EventData *data = new_event_data(window, EventNewWindow, 0);
OBClient *newfocus = 0;
OBClient::List::iterator it, end = _stacking.end();
for (it = _stacking.begin(); it != end; ++it)
- if ((*it)->normal() && (*it)->focus()) {
+ if ((*it)->desktop() == _desktop && (*it)->normal() && (*it)->focus()) {
newfocus = *it;
break;
}
if (!(desktop >= 0 && desktop < _num_desktops)) return;
+ printf("Moving to desktop %ld\n", desktop);
+
long old = _desktop;
_desktop = desktop;
otk::OBProperty::Atom_Cardinal,
_desktop);
+ if (old == _desktop) return;
+
OBClient::List::iterator it, end = clients.end();
for (it = clients.begin(); it != end; ++it) {
if ((*it)->desktop() == old) {
- // XXX hide
+ (*it)->frame->hide();
} else if ((*it)->desktop() == _desktop) {
- // XXX show
+ (*it)->frame->show();
}
}
}
if (!(num > 0)) return;
+ // XXX: move windows on desktops that will no longer exist!
+
_num_desktops = num;
Openbox::instance->property()->set(_info->rootWindow(),
otk::OBProperty::net_number_of_desktops,