new feature: add option to center pointer on focused client

This commit is contained in:
Julien Danjou 2007-10-08 14:25:36 +02:00
parent 158b91adaf
commit 3046af6f54
4 changed files with 10 additions and 0 deletions

View File

@ -38,6 +38,9 @@ awesome:
# Resize hints
resize_hints = true;
# Move pointer to the center of the focused window
focus_move_pointer = false;
# Set of rules to put some windows floating
# or to tag them on launch
rules = ({ name = "Gimp";

View File

@ -402,6 +402,9 @@ parse_config(Display * disp, int scr, DC * drawcontext, const char *confpatharg,
/* resize_hints */
awesomeconf->resize_hints = config_lookup_bool(&awesomelibconf, "awesome.resize_hints");
/* focus_move_pointer */
awesomeconf->focus_move_pointer = config_lookup_bool(&awesomelibconf, "awesome.focus_move_pointer");
/* colors */
tmp = config_lookup_string(&awesomelibconf, "awesome.normal_border_color");
colorbuf = initxcolor(disp, awesomeconf->phys_screen, tmp ? tmp : "#dddddd");

View File

@ -145,6 +145,8 @@ struct awesome_config
int ncols;
/** Transparency of unfocused clients */
int opacity_unfocused;
/** Focus move pointer */
Bool focus_move_pointer;
/** Respect resize hints */
Bool resize_hints;
/** Text displayed in bar */

View File

@ -142,6 +142,8 @@ restack(Display * disp, DC * drawcontext, awesome_config *awesomeconf)
wc.sibling = c->win;
}
}
if(awesomeconf->focus_move_pointer)
XWarpPointer(disp, None, sel->win, 0, 0, 0, 0, sel->w / 2, sel->h / 2);
XSync(disp, False);
while(XCheckMaskEvent(disp, EnterWindowMask, &ev));
}