summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-11-07 08:22:27 +0000
committerDana Jansens <danakj@orodu.net>2002-11-07 08:22:27 +0000
commit8b041e2f5c2edc6d295697d129cbc65b9bb2c6b7 (patch)
tree59f53f6b7e6c09300ae9b2f39e8000306eb29b58 /src
parentab88b1b9cd80a389dc1871ffb39b3fa42df5a53d (diff)
add updateIconTitle
Diffstat (limited to 'src')
-rw-r--r--src/client.cc29
1 files changed, 26 insertions, 3 deletions
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))