aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2007-10-22 18:29:33 (GMT)
committerfluxgen <fluxgen>2007-10-22 18:29:33 (GMT)
commitc2badda58a53ed00f8a53e9ce162d52669296741 (patch)
treee155cd062e76548e8ffb75c8ed47aabe72bb4382 /src
parent1748e8ec25e4236d85e6783aa9a8026c6329376f (diff)
downloadfluxbox_paul-c2badda58a53ed00f8a53e9ce162d52669296741.zip
fluxbox_paul-c2badda58a53ed00f8a53e9ce162d52669296741.tar.bz2
added [mouse] pattern, matches against prop HEAD and the mouse position
Diffstat (limited to 'src')
-rw-r--r--src/ClientPattern.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc
index 538b708..3cb9e9f 100644
--- a/src/ClientPattern.cc
+++ b/src/ClientPattern.cc
@@ -275,6 +275,25 @@ bool ClientPattern::match(const Focusable &win) const {
275 getProperty((*it)->prop, *focused)) 275 getProperty((*it)->prop, *focused))
276 return false; 276 return false;
277 } 277 }
278 } else if ((*it)->prop == HEAD &&
279 (*it)->orig == "[mouse]") {
280 // use the mouse position to determine which
281 // head to compare the window to
282 int x, y;
283 int win_x, win_y; // not used
284 Window root, child; // not used
285 unsigned int mask; // not used
286 if ( ! XQueryPointer(FbTk::App::instance()->display(),
287 win.screen().rootWindow().window(),
288 &root, &child, &x, &y,
289 &win_x, &win_y, &mask) ) {
290 return false;
291 }
292 char num[32];
293 sprintf(num, "%d", win.screen().getHead(x, y));
294 if (getProperty((*it)->prop, win) != num)
295 return false;
296
278 } else if (!(*it)->regexp.match(getProperty((*it)->prop, win))) 297 } else if (!(*it)->regexp.match(getProperty((*it)->prop, win)))
279 return false; 298 return false;
280 } 299 }