// Set the netwm atoms for geomtery and viewport
- unsigned long geometry[] = { _size.x(),
- _size.y() };
+ unsigned long geometry[] = { _info->getWidth(),
+ _info->getHeight() };
Openbox::instance->property()->set(_info->getRootWindow(),
otk::OBProperty::net_desktop_geometry,
otk::OBProperty::Atom_Cardinal,
// unmanage all windows
while (!_clients.empty())
- unmanageWindow(_clients[0]);
+ unmanageWindow(_clients.front());
delete _image_control;
}
XWMHints *wmhint;
XSetWindowAttributes attrib_set;
- printf("Managing Window: %lx\n", window);
-
// is the window a docking app
if ((wmhint = XGetWMHints(otk::OBDisplay::display, window))) {
if ((wmhint->flags & StateHint) &&
XFree(wmhint);
}
+ otk::OBDisplay::grab();
+
// choose the events we want to receive on the CLIENT window
attrib_set.event_mask = OBClient::event_mask;
attrib_set.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask |
// create the decoration frame for the client window
client->frame = new OBFrame(client, &_style);
- // add all the client's decoration windows as event handlers for the client
+ // XXX: if on the current desktop..
+ XMapWindow(otk::OBDisplay::display, client->frame->window());
+
+ // XXX: handle any requested states such as shaded/maximized
+
+ otk::OBDisplay::ungrab();
+
+ // add all the client's windows as event handlers for the client
+ Openbox::instance->addClient(window, client);
Openbox::instance->addClient(client->frame->window(), client);
Openbox::instance->addClient(client->frame->titlebar(), client);
Openbox::instance->addClient(client->frame->buttonIconify(), client);
Openbox::instance->addClient(client->frame->handle(), client);
Openbox::instance->addClient(client->frame->gripLeft(), client);
Openbox::instance->addClient(client->frame->gripRight(), client);
-
- // XXX: if on the current desktop..
- XMapWindow(otk::OBDisplay::display, client->frame->window());
-
- // XXX: handle any requested states such as shaded/maximized
-
+ // add to the screen's list
_clients.push_back(client);
+ // update the root properties
setClientList();
}
delete client->frame;
client->frame = 0;
- ClientList::iterator it = _clients.begin(), end = _clients.end();
- for (; it != end; ++it)
- if (*it == client) {
- _clients.erase(it);
- break;
- }
+ // remove from the screen's list
+ _clients.remove(client);
delete client;
+ // update the root properties
setClientList();
}