diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-01-07 00:57:00 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-01-07 00:57:00 +0000 |
| commit | 00e2c5aaad4a0831fd1e0d1b1c287df4d6eaac93 (patch) | |
| tree | b2a675761ae4f6783e0dc1d2432fd7de22226c2d /src/rootwindow.cc | |
| parent | 07d835a044c750c6ed8d58466fc5cc6a5808a8ac (diff) | |
keep track of desktops...
Diffstat (limited to 'src/rootwindow.cc')
| -rw-r--r-- | src/rootwindow.cc | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/src/rootwindow.cc b/src/rootwindow.cc index 78017dd3..0b7de57d 100644 --- a/src/rootwindow.cc +++ b/src/rootwindow.cc @@ -27,102 +27,7 @@ OBRootWindow::~OBRootWindow() } -void OBRootWindow::updateDesktopNames() -{ - const int numWorkspaces = 1; // XXX: change this to the number of workspaces! - - const otk::OBProperty *property = Openbox::instance->property(); - - unsigned long num = (unsigned) -1; - - if (!property->get(_info->rootWindow(), - otk::OBProperty::net_desktop_names, - otk::OBProperty::utf8, &num, &_names)) - _names.clear(); - while ((signed)_names.size() < numWorkspaces) - _names.push_back("Unnamed"); -} - - -void OBRootWindow::propertyHandler(const XPropertyEvent &e) -{ - otk::OtkEventHandler::propertyHandler(e); - - const otk::OBProperty *property = Openbox::instance->property(); - - // compress changes to a single property into a single change - XEvent ce; - while (XCheckTypedEvent(otk::OBDisplay::display, e.type, &ce)) { - // XXX: it would be nice to compress ALL changes to a property, not just - // changes in a row without other props between. - if (ce.xproperty.atom != e.atom) { - XPutBackEvent(otk::OBDisplay::display, &ce); - break; - } - } - - if (e.atom == property->atom(otk::OBProperty::net_desktop_names)) - updateDesktopNames(); -} - - -void OBRootWindow::clientMessageHandler(const XClientMessageEvent &e) -{ - otk::OtkEventHandler::clientMessageHandler(e); - - if (e.format != 32) return; - //const otk::OBProperty *property = Openbox::instance->property(); - - // XXX: so many client messages to handle here! ..or not.. they go to clients -} - - -void OBRootWindow::setDesktopNames(const otk::OBProperty::StringVect &names) -{ - _names = names; - const otk::OBProperty *property = Openbox::instance->property(); - property->set(_info->rootWindow(), otk::OBProperty::net_desktop_names, - otk::OBProperty::utf8, names); -} - -void OBRootWindow::setDesktopName(int i, const std::string &name) -{ - const int numWorkspaces = 1; // XXX: change this to the number of workspaces! - assert(i >= 0); - assert(i < numWorkspaces); - const otk::OBProperty *property = Openbox::instance->property(); - - otk::OBProperty::StringVect newnames = _names; - newnames[i] = name; - property->set(_info->rootWindow(), otk::OBProperty::net_desktop_names, - otk::OBProperty::utf8, newnames); -} - - -void OBRootWindow::mapRequestHandler(const XMapRequestEvent &e) -{ - otk::OtkEventHandler::mapRequestHandler(e); - -#ifdef DEBUG - printf("MapRequest for 0x%lx\n", e.window); -#endif // DEBUG - - /* - MapRequest events come here even after the window exists instead of going - right to the client window, because of how they are sent and their struct - layout. - */ - OBClient *c = Openbox::instance->findClient(e.window); - - if (c) { - if (c->shaded()) - c->shade(false); - // XXX: uniconify the window - c->focus(); - } else - Openbox::instance->screen(_info->screen())->manageWindow(e.window); -} } |
