From d13f021b8bb2a6b8e49f69a370409e79a7f02213 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 4 Jan 2003 19:09:52 +0000 Subject: add support for wm_window_role --- src/client.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/client.cc') diff --git a/src/client.cc b/src/client.cc index a6990a8d..7b846729 100644 --- a/src/client.cc +++ b/src/client.cc @@ -478,17 +478,23 @@ void OBClient::updateClass() const otk::OBProperty *property = Openbox::instance->property(); // set the defaults - _app_name = _app_class = ""; + _app_name = _app_class = _role = ""; otk::OBProperty::StringVect v; unsigned long num = 2; - if (! property->get(_window, otk::OBProperty::wm_class, - otk::OBProperty::ascii, &num, &v)) - return; + if (property->get(_window, otk::OBProperty::wm_class, + otk::OBProperty::ascii, &num, &v)) { + if (num > 0) _app_name = v[0]; + if (num > 1) _app_class = v[1]; + } - if (num > 0) _app_name = v[0]; - if (num > 1) _app_class = v[1]; + v.clear(); + num = 1; + if (property->get(_window, otk::OBProperty::wm_window_role, + otk::OBProperty::ascii, &num, &v)) { + if (num > 0) _role = v[0]; + } } -- cgit v1.2.3