X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fscreen.cc;h=e3217cca3e64a8f6cc64401ec97528b84749ab2f;hb=0da967a8313bad4a9dbcca9b5c760bda32b7981f;hp=9d316ce4852f1f31d867341a3ad4e27e4dce1a9e;hpb=24dd636f7318b0d21637aa7ffe253fe0ebf71f24;p=chaz%2Fopenbox diff --git a/src/screen.cc b/src/screen.cc index 9d316ce4..e3217cca 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -76,8 +76,8 @@ OBScreen::OBScreen(int screen, const otk::Configuration &config) // 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, @@ -101,7 +101,7 @@ OBScreen::~OBScreen() // unmanage all windows while (!_clients.empty()) - unmanageWindow(_clients[0]); + unmanageWindow(_clients.front()); delete _image_control; } @@ -338,6 +338,8 @@ void OBScreen::manageWindow(Window window) 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 | @@ -362,7 +364,15 @@ void OBScreen::manageWindow(Window window) // 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); @@ -373,14 +383,10 @@ void OBScreen::manageWindow(Window window) 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(); } @@ -420,14 +426,11 @@ void OBScreen::unmanageWindow(OBClient *client) 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(); }