added [mouse] pattern, matches against prop HEAD and the mouse position
fluxgen fluxgen
2 files changed,
25 insertions(+),
0 deletions(-)
M
ChangeLog
→
ChangeLog
@@ -1,6 +1,12 @@
(Format: Year/Month/Day) Changes for 1.0.1: *07/10/22: + * Added option "mouse" to client pattern ( Henrik ) + This is usefull for xinerama. For example: + Mod1 Tab :NextWindow (head=[mouse]) + This will cycle focus through windows that are on the same head as + the mouse pointer. + ClientPattern.cc * Fixed crash bug at restart. ( Henrik ) Window.cc * Replaced modKey with new commands StartMoving and StartResizing (Mark)
M
src/ClientPattern.cc
→
src/ClientPattern.cc
@@ -275,6 +275,25 @@ if (!focused || getProperty((*it)->prop, win) !=
getProperty((*it)->prop, *focused)) return false; } + } else if ((*it)->prop == HEAD && + (*it)->orig == "[mouse]") { + // use the mouse position to determine which + // head to compare the window to + int x, y; + int win_x, win_y; // not used + Window root, child; // not used + unsigned int mask; // not used + if ( ! XQueryPointer(FbTk::App::instance()->display(), + win.screen().rootWindow().window(), + &root, &child, &x, &y, + &win_x, &win_y, &mask) ) { + return false; + } + char num[32]; + sprintf(num, "%d", win.screen().getHead(x, y)); + if (getProperty((*it)->prop, win) != num) + return false; + } else if (!(*it)->regexp.match(getProperty((*it)->prop, win))) return false; }