diff --git a/awesomerc b/awesomerc index 12a12e227..2392f71d4 100644 --- a/awesomerc +++ b/awesomerc @@ -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"; diff --git a/config.c b/config.c index f261c3b0b..a89a3c7ac 100644 --- a/config.c +++ b/config.c @@ -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"); diff --git a/config.h b/config.h index e8409f121..6d799a7d5 100644 --- a/config.h +++ b/config.h @@ -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 */ diff --git a/layout.c b/layout.c index 29e023b99..606809917 100644 --- a/layout.c +++ b/layout.c @@ -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)); }