void Screen::calcArea()
{
- otk::Rect old_area = _area;
+// otk::Rect old_area = _area;
/*
#ifdef XINERAMA
#endif // XINERAMA
*/
- if (old_area != _area)
+ //if (old_area != _area)
// XXX: re-maximize windows
changeWorkArea();
Client *client = 0;
XWMHints *wmhint;
XSetWindowAttributes attrib_set;
+ XEvent e;
+ XWindowAttributes attrib;
otk::display->grab();
+ // check if it has already been unmapped by the time we started mapping
+ // the grab does a sync so we don't have to here
+ if (XCheckTypedWindowEvent(**otk::display, window, DestroyNotify, &e) ||
+ XCheckTypedWindowEvent(**otk::display, window, UnmapNotify, &e)) {
+ XPutBackEvent(**otk::display, &e);
+
+ otk::display->ungrab();
+ return; // don't manage it
+ }
+
+ if (!XGetWindowAttributes(**otk::display, window, &attrib) ||
+ attrib.override_redirect) {
+ otk::display->ungrab();
+ return; // don't manage it
+ }
+
// is the window a docking app
if ((wmhint = XGetWMHints(**otk::display, window))) {
if ((wmhint->flags & StateHint) &&
wmhint->initial_state == WithdrawnState) {
//slit->addClient(w); // XXX: make dock apps work!
- otk::display->ungrab();
+ otk::display->ungrab();
XFree(wmhint);
return;
}
openbox->bindings()->fireEvent(&data);
}
+ EventData ddata(_number, client, EventAction::DisplayingWindow, 0);
+ openbox->bindings()->fireEvent(&ddata);
+
// if on the current desktop.. (or all desktops)
if (client->desktop() == _desktop ||
client->desktop() == (signed)0xffffffff) {
// add to the screen's list
clients.push_back(client);
+ // once the client is in the list, update our strut to include the new
+ // client's
+ updateStrut();
// this puts into the stacking order, then raises it
_stacking.push_back(client);
raiseWindow(client);
openbox->bindings()->grabButtons(true, client);
- // call the python NEWWINDOW binding
- EventData data(_number, client, EventAction::NewWindow, 0);
- openbox->bindings()->fireEvent(&data);
+ EventData ndata(_number, client, EventAction::NewWindow, 0);
+ openbox->bindings()->fireEvent(&ndata);
#ifdef DEBUG
printf("Managed window 0x%lx frame 0x%lx\n",