X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fscreen.cc;h=e3217cca3e64a8f6cc64401ec97528b84749ab2f;hb=0da967a8313bad4a9dbcca9b5c760bda32b7981f;hp=3c63aa3489445276886f2a9cf35bfdb7bafae70e;hpb=06a80ce2c7a189e26063d5e4e475ca500778aba5;p=chaz%2Fopenbox diff --git a/src/screen.cc b/src/screen.cc index 3c63aa34..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, @@ -92,10 +92,6 @@ OBScreen::OBScreen(int screen, const otk::Configuration &config) // the manageExising() function setClientList(); // initialize the client lists, which will be empty calcArea(); // initialize the available working area - - manageExisting(); - - // XXX: "change to" the first workspace to initialize stuff } @@ -105,7 +101,7 @@ OBScreen::~OBScreen() // unmanage all windows while (!_clients.empty()) - unmanageWindow(_clients[0]); + unmanageWindow(_clients.front()); delete _image_control; } @@ -331,8 +327,6 @@ void OBScreen::manageWindow(Window window) XWMHints *wmhint; XSetWindowAttributes attrib_set; - // XXX: manage the window, i.e. grab events n shit - // is the window a docking app if ((wmhint = XGetWMHints(otk::OBDisplay::display, window))) { if ((wmhint->flags & StateHint) && @@ -344,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 | @@ -368,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); @@ -379,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(); } @@ -426,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(); }