aboutsummaryrefslogtreecommitdiff
path: root/src/ClientPattern.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-11-12 21:59:43 (GMT)
committermarkt <markt>2007-11-12 21:59:43 (GMT)
commit5d7043320da1378e7dd3b10f7e425f3b47455b28 (patch)
tree305db18a58ab6768b78ab230074da576d09e372d /src/ClientPattern.cc
parent807a1b557552e43dbdc169c1e7a3065a3f12aac7 (diff)
downloadfluxbox-5d7043320da1378e7dd3b10f7e425f3b47455b28.zip
fluxbox-5d7043320da1378e7dd3b10f7e425f3b47455b28.tar.bz2
allow arbitrary window patterns in iconbar
Diffstat (limited to 'src/ClientPattern.cc')
-rw-r--r--src/ClientPattern.cc36
1 files changed, 33 insertions, 3 deletions
diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc
index 9ee1848..d094e63 100644
--- a/src/ClientPattern.cc
+++ b/src/ClientPattern.cc
@@ -274,9 +274,19 @@ bool ClientPattern::match(const Focusable &win) const {
274 for (; it != it_end; ++it) { 274 for (; it != it_end; ++it) {
275 if ((*it)->orig == "[current]") { 275 if ((*it)->orig == "[current]") {
276 WinClient *focused = FocusControl::focusedWindow(); 276 WinClient *focused = FocusControl::focusedWindow();
277 if (!focused || !((*it)->negate ^ 277 if ((*it)->prop == WORKSPACE) {
278 (getProperty((*it)->prop, win) == 278 char tmpstr[128];
279 getProperty((*it)->prop, *focused)))) 279 sprintf(tmpstr, "%d", win.screen().currentWorkspaceID());
280 if (!(*it)->negate ^ (getProperty((*it)->prop, win) == tmpstr))
281 return false;
282 } else if ((*it)->prop == WORKSPACENAME) {
283 const Workspace *w = win.screen().currentWorkspace();
284 if (!w || (!(*it)->negate ^
285 (getProperty((*it)->prop, win) == w->name())))
286 return false;
287 } else if (!focused || (!(*it)->negate ^
288 (getProperty((*it)->prop, win) ==
289 getProperty((*it)->prop, *focused))))
280 return false; 290 return false;
281 } else if ((*it)->prop == HEAD && 291 } else if ((*it)->prop == HEAD &&
282 (*it)->orig == "[mouse]") { 292 (*it)->orig == "[mouse]") {
@@ -293,6 +303,26 @@ bool ClientPattern::match(const Focusable &win) const {
293 return true; 303 return true;
294} 304}
295 305
306bool ClientPattern::dependsOnFocusedWindow() const {
307 Terms::const_iterator it = m_terms.begin(), it_end = m_terms.end();
308 for (; it != it_end; ++it) {
309 if ((*it)->prop != WORKSPACE && (*it)->prop != WORKSPACENAME &&
310 (*it)->orig == "[current]")
311 return true;
312 }
313 return false;
314}
315
316bool ClientPattern::dependsOnCurrentWorkspace() const {
317 Terms::const_iterator it = m_terms.begin(), it_end = m_terms.end();
318 for (; it != it_end; ++it) {
319 if (((*it)->prop == WORKSPACE || (*it)->prop == WORKSPACENAME) &&
320 (*it)->orig == "[current]")
321 return true;
322 }
323 return false;
324}
325
296// add an expression to match against 326// add an expression to match against
297// The first argument is a regular expression, the second is the member 327// The first argument is a regular expression, the second is the member
298// function that we wish to match against. 328// function that we wish to match against.