X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fclient.cc;h=4a99b0bc58eecbb27ca21870ae57c743c0a79f80;hb=b0149ef3fd8eeafc6a7fc008468d36c3b86b9008;hp=6b67f3c290aa9f1a3909169b84bb2fa2238f2de1;hpb=f7f3cd4085b8210bcefc1fd1f40df6eafea3035e;p=chaz%2Fopenbox diff --git a/src/client.cc b/src/client.cc index 6b67f3c2..4a99b0bc 100644 --- a/src/client.cc +++ b/src/client.cc @@ -75,6 +75,7 @@ OBClient::OBClient(Window window) updateWMHints(); // XXX: updateTransientFor(); updateTitle(); + updateIconTitle(); updateClass(); #ifdef DEBUG @@ -328,6 +329,8 @@ void OBClient::updateProtocols() int num_return = 0; _focus_notify = false; + _decorations &= ~Decor_Close; + _functions &= ~Func_Close; if (XGetWMProtocols(otk::OBDisplay::display, _window, &proto, &num_return)) { for (int i = 0; i < num_return; ++i) { @@ -438,6 +441,25 @@ void OBClient::updateTitle() } +void OBClient::updateIconTitle() +{ + const otk::OBProperty *property = Openbox::instance->property(); + + _icon_title = ""; + + // try netwm + if (! property->get(_window, otk::OBProperty::net_wm_icon_name, + otk::OBProperty::utf8, &_icon_title)) { + // try old x stuff + property->get(_window, otk::OBProperty::wm_icon_name, + otk::OBProperty::ascii, &_icon_title); + } + + if (_title.empty()) + _icon_title = _("Unnamed Window"); +} + + void OBClient::updateClass() { const otk::OBProperty *property = Openbox::instance->property(); @@ -466,10 +488,11 @@ void OBClient::update(const XPropertyEvent &e) else if (e.atom == XA_WM_HINTS) updateWMHints(); else if (e.atom == property->atom(otk::OBProperty::net_wm_name) || - e.atom == property->atom(otk::OBProperty::wm_name) || - e.atom == property->atom(otk::OBProperty::net_wm_icon_name) || - e.atom == property->atom(otk::OBProperty::wm_icon_name)) + e.atom == property->atom(otk::OBProperty::wm_name)) updateTitle(); + else if (e.atom == property->atom(otk::OBProperty::net_wm_icon_name) || + e.atom == property->atom(otk::OBProperty::wm_icon_name)) + updateIconTitle(); else if (e.atom == property->atom(otk::OBProperty::wm_class)) updateClass(); else if (e.atom == property->atom(otk::OBProperty::wm_protocols))