all repos — openbox @ 8b041e2f5c2edc6d295697d129cbc65b9bb2c6b7

openbox fork - make it a bit more like ryudo

add updateIconTitle
Dana Jansens danakj@orodu.net
commit

8b041e2f5c2edc6d295697d129cbc65b9bb2c6b7

parent

ab88b1b9cd80a389dc1871ffb39b3fa42df5a53d

1 files changed, 26 insertions(+), 3 deletions(-)

jump to
M src/client.ccsrc/client.cc

@@ -75,6 +75,7 @@ updateNormalHints();

updateWMHints(); // XXX: updateTransientFor(); updateTitle(); + updateIconTitle(); updateClass(); #ifdef DEBUG

@@ -328,6 +329,8 @@ Atom *proto;

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 @@ _title = _("Unnamed Window");

} +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 @@ updateNormalHints();

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_name)) + updateTitle(); + else if (e.atom == property->atom(otk::OBProperty::net_wm_icon_name) || e.atom == property->atom(otk::OBProperty::wm_icon_name)) - updateTitle(); + updateIconTitle(); else if (e.atom == property->atom(otk::OBProperty::wm_class)) updateClass(); else if (e.atom == property->atom(otk::OBProperty::wm_protocols))