diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/ClientPattern.cc | 19 |
2 files changed, 25 insertions, 0 deletions
@@ -1,6 +1,12 @@ | |||
1 | (Format: Year/Month/Day) | 1 | (Format: Year/Month/Day) |
2 | Changes for 1.0.1: | 2 | Changes 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 | } |