aboutsummaryrefslogtreecommitdiff
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
parent1748e8ec25e4236d85e6783aa9a8026c6329376f (diff)
downloadfluxbox_pavel-c2badda58a53ed00f8a53e9ce162d52669296741.zip
fluxbox_pavel-c2badda58a53ed00f8a53e9ce162d52669296741.tar.bz2
added [mouse] pattern, matches against prop HEAD and the mouse position
-rw-r--r--ChangeLog6
-rw-r--r--src/ClientPattern.cc19
2 files changed, 25 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index eb3c57f..e4024fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.0.1: 2Changes for 1.0.1:
3*07/10/22: 3*07/10/22:
4 * Added option "mouse" to client pattern ( Henrik )
5 This is usefull for xinerama. For example:
6 Mod1 Tab :NextWindow (head=[mouse])
7 This will cycle focus through windows that are on the same head as
8 the mouse pointer.
9 ClientPattern.cc
4 * Fixed crash bug at restart. ( Henrik ) 10 * Fixed crash bug at restart. ( Henrik )
5 Window.cc 11 Window.cc
6 * Replaced modKey with new commands StartMoving and StartResizing (Mark) 12 * Replaced modKey with new commands StartMoving and StartResizing (Mark)
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 }