aboutsummaryrefslogtreecommitdiff
path: root/src/ClientPattern.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/ClientPattern.cc')
-rw-r--r--src/ClientPattern.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc
index f41ccb0..2fba185 100644
--- a/src/ClientPattern.cc
+++ b/src/ClientPattern.cc
@@ -20,12 +20,13 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: ClientPattern.cc,v 1.6 2003/12/17 01:19:39 fluxgen Exp $ 23// $Id: ClientPattern.cc,v 1.7 2004/04/28 13:04:06 rathnor Exp $
24 24
25#include "ClientPattern.hh" 25#include "ClientPattern.hh"
26#include "RegExp.hh" 26#include "RegExp.hh"
27#include "StringUtil.hh" 27#include "StringUtil.hh"
28#include "WinClient.hh" 28#include "WinClient.hh"
29#include "FbTk/App.hh"
29 30
30// use GNU extensions 31// use GNU extensions
31#ifndef _GNU_SOURCE 32#ifndef _GNU_SOURCE
@@ -110,6 +111,8 @@ ClientPattern::ClientPattern(const char *str):
110 prop = CLASS; 111 prop = CLASS;
111 } else if (strcasecmp(memstr.c_str(), "title") == 0) { 112 } else if (strcasecmp(memstr.c_str(), "title") == 0) {
112 prop = TITLE; 113 prop = TITLE;
114 } else if (strcasecmp(memstr.c_str(), "role") == 0) {
115 prop = ROLE;
113 } else { 116 } else {
114 had_error = pos + match.find_first_of('(') + 1; 117 had_error = pos + match.find_first_of('(') + 1;
115 break; 118 break;
@@ -186,6 +189,8 @@ std::string ClientPattern::toString() const {
186 case TITLE: 189 case TITLE:
187 pat.append("title="); 190 pat.append("title=");
188 break; 191 break;
192 case ROLE:
193 pat.append("role=");
189 } 194 }
190 195
191 pat.append((*it)->orig); 196 pat.append((*it)->orig);
@@ -246,6 +251,10 @@ std::string ClientPattern::getProperty(WinProperty prop, const WinClient &client
246 case NAME: 251 case NAME:
247 return client.getWMClassName(); 252 return client.getWMClassName();
248 break; 253 break;
254 case ROLE:
255 Atom wm_role = XInternAtom(FbTk::App::instance()->display(), "WM_WINDOW_ROLE", False);
256 return client.textProperty(wm_role);
257 break;
249 } 258 }
250 return client.getWMClassName(); 259 return client.getWMClassName();
251} 260}