diff options
Diffstat (limited to 'src/ClientPattern.cc')
-rw-r--r-- | src/ClientPattern.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc index 9324bee..538b708 100644 --- a/src/ClientPattern.cc +++ b/src/ClientPattern.cc | |||
@@ -60,7 +60,7 @@ ClientPattern::ClientPattern(): | |||
60 | m_nummatches(0) {} | 60 | m_nummatches(0) {} |
61 | 61 | ||
62 | // parse the given pattern (to end of line) | 62 | // parse the given pattern (to end of line) |
63 | ClientPattern::ClientPattern(const char *str): | 63 | ClientPattern::ClientPattern(const char *str, bool default_no_transient): |
64 | m_matchlimit(0), | 64 | m_matchlimit(0), |
65 | m_nummatches(0) | 65 | m_nummatches(0) |
66 | { | 66 | { |
@@ -107,6 +107,9 @@ ClientPattern::ClientPattern(const char *str): | |||
107 | prop = TITLE; | 107 | prop = TITLE; |
108 | } else if (strcasecmp(memstr.c_str(), "role") == 0) { | 108 | } else if (strcasecmp(memstr.c_str(), "role") == 0) { |
109 | prop = ROLE; | 109 | prop = ROLE; |
110 | } else if (strcasecmp(memstr.c_str(), "transient") == 0) { | ||
111 | prop = TRANSIENT; | ||
112 | default_no_transient = false; | ||
110 | } else if (strcasecmp(memstr.c_str(), "maximized") == 0) { | 113 | } else if (strcasecmp(memstr.c_str(), "maximized") == 0) { |
111 | prop = MAXIMIZED; | 114 | prop = MAXIMIZED; |
112 | } else if (strcasecmp(memstr.c_str(), "minimized") == 0) { | 115 | } else if (strcasecmp(memstr.c_str(), "minimized") == 0) { |
@@ -138,6 +141,9 @@ ClientPattern::ClientPattern(const char *str): | |||
138 | had_error = true; | 141 | had_error = true; |
139 | } | 142 | } |
140 | 143 | ||
144 | if (default_no_transient) | ||
145 | had_error = !addTerm("no", TRANSIENT); | ||
146 | |||
141 | if (!had_error) { | 147 | if (!had_error) { |
142 | // otherwise, we check for a number | 148 | // otherwise, we check for a number |
143 | string number; | 149 | string number; |
@@ -201,6 +207,9 @@ string ClientPattern::toString() const { | |||
201 | case ROLE: | 207 | case ROLE: |
202 | pat.append("role="); | 208 | pat.append("role="); |
203 | break; | 209 | break; |
210 | case TRANSIENT: | ||
211 | pat.append("transient="); | ||
212 | break; | ||
204 | case MAXIMIZED: | 213 | case MAXIMIZED: |
205 | pat.append("maximized="); | 214 | pat.append("maximized="); |
206 | break; | 215 | break; |
@@ -307,6 +316,9 @@ string ClientPattern::getProperty(WinProperty prop, | |||
307 | case ROLE: | 316 | case ROLE: |
308 | return client.getWMRole(); | 317 | return client.getWMRole(); |
309 | break; | 318 | break; |
319 | case TRANSIENT: | ||
320 | return client.isTransient() ? "yes" : "no"; | ||
321 | break; | ||
310 | case MAXIMIZED: | 322 | case MAXIMIZED: |
311 | return (fbwin && fbwin->isMaximized()) ? "yes" : "no"; | 323 | return (fbwin && fbwin->isMaximized()) ? "yes" : "no"; |
312 | break; | 324 | break; |