new feature: add option to center pointer on focused client
This commit is contained in:
parent
158b91adaf
commit
3046af6f54
|
@ -38,6 +38,9 @@ awesome:
|
||||||
# Resize hints
|
# Resize hints
|
||||||
resize_hints = true;
|
resize_hints = true;
|
||||||
|
|
||||||
|
# Move pointer to the center of the focused window
|
||||||
|
focus_move_pointer = false;
|
||||||
|
|
||||||
# Set of rules to put some windows floating
|
# Set of rules to put some windows floating
|
||||||
# or to tag them on launch
|
# or to tag them on launch
|
||||||
rules = ({ name = "Gimp";
|
rules = ({ name = "Gimp";
|
||||||
|
|
3
config.c
3
config.c
|
@ -402,6 +402,9 @@ parse_config(Display * disp, int scr, DC * drawcontext, const char *confpatharg,
|
||||||
/* resize_hints */
|
/* resize_hints */
|
||||||
awesomeconf->resize_hints = config_lookup_bool(&awesomelibconf, "awesome.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 */
|
/* colors */
|
||||||
tmp = config_lookup_string(&awesomelibconf, "awesome.normal_border_color");
|
tmp = config_lookup_string(&awesomelibconf, "awesome.normal_border_color");
|
||||||
colorbuf = initxcolor(disp, awesomeconf->phys_screen, tmp ? tmp : "#dddddd");
|
colorbuf = initxcolor(disp, awesomeconf->phys_screen, tmp ? tmp : "#dddddd");
|
||||||
|
|
2
config.h
2
config.h
|
@ -145,6 +145,8 @@ struct awesome_config
|
||||||
int ncols;
|
int ncols;
|
||||||
/** Transparency of unfocused clients */
|
/** Transparency of unfocused clients */
|
||||||
int opacity_unfocused;
|
int opacity_unfocused;
|
||||||
|
/** Focus move pointer */
|
||||||
|
Bool focus_move_pointer;
|
||||||
/** Respect resize hints */
|
/** Respect resize hints */
|
||||||
Bool resize_hints;
|
Bool resize_hints;
|
||||||
/** Text displayed in bar */
|
/** Text displayed in bar */
|
||||||
|
|
2
layout.c
2
layout.c
|
@ -142,6 +142,8 @@ restack(Display * disp, DC * drawcontext, awesome_config *awesomeconf)
|
||||||
wc.sibling = c->win;
|
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);
|
XSync(disp, False);
|
||||||
while(XCheckMaskEvent(disp, EnterWindowMask, &ev));
|
while(XCheckMaskEvent(disp, EnterWindowMask, &ev));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue