add sloppy_focus_raise option

This commit is contained in:
Julien Danjou 2008-01-25 23:27:32 +01:00
parent a601553e3c
commit e32070cffb
4 changed files with 8 additions and 2 deletions

View File

@ -332,7 +332,6 @@ screen <integer> [MULTI]
{ {
general general
{ {
allow_lower_floats = <boolean>
border = <integer> border = <integer>
focus_move_pointer = <boolean> focus_move_pointer = <boolean>
font = <font> font = <font>
@ -340,6 +339,7 @@ screen <integer> [MULTI]
new_get_focus = <boolean> new_get_focus = <boolean>
resize_hints = <boolean> resize_hints = <boolean>
sloppy_focus = <boolean> sloppy_focus = <boolean>
sloppy_focus_raise = <boolean>
snap = <integer> snap = <integer>
} }
tags tags

View File

@ -314,6 +314,7 @@ config_parse_screen(cfg_t *cfg, int screen)
virtscreen->resize_hints = cfg_getbool(cfg_general, "resize_hints"); virtscreen->resize_hints = cfg_getbool(cfg_general, "resize_hints");
virtscreen->focus_move_pointer = cfg_getbool(cfg_general, "focus_move_pointer"); virtscreen->focus_move_pointer = cfg_getbool(cfg_general, "focus_move_pointer");
virtscreen->sloppy_focus = cfg_getbool(cfg_general, "sloppy_focus"); virtscreen->sloppy_focus = cfg_getbool(cfg_general, "sloppy_focus");
virtscreen->sloppy_focus_raise = cfg_getbool(cfg_general, "sloppy_focus_raise");
virtscreen->new_become_master = cfg_getbool(cfg_general, "new_become_master"); virtscreen->new_become_master = cfg_getbool(cfg_general, "new_become_master");
virtscreen->new_get_focus = cfg_getbool(cfg_general, "new_get_focus"); virtscreen->new_get_focus = cfg_getbool(cfg_general, "new_get_focus");
virtscreen->font = XftFontOpenName(globalconf.display, virtscreen->font = XftFontOpenName(globalconf.display,
@ -442,6 +443,7 @@ config_parse(const char *confpatharg)
CFG_BOOL((char *) "resize_hints", cfg_true, CFGF_NONE), CFG_BOOL((char *) "resize_hints", cfg_true, CFGF_NONE),
CFG_BOOL((char *) "focus_move_pointer", cfg_false, CFGF_NONE), CFG_BOOL((char *) "focus_move_pointer", cfg_false, CFGF_NONE),
CFG_BOOL((char *) "sloppy_focus", cfg_true, CFGF_NONE), CFG_BOOL((char *) "sloppy_focus", cfg_true, CFGF_NONE),
CFG_BOOL((char *) "sloppy_focus_raise", cfg_true, CFGF_NONE),
CFG_BOOL((char *) "new_become_master", cfg_true, CFGF_NONE), CFG_BOOL((char *) "new_become_master", cfg_true, CFGF_NONE),
CFG_BOOL((char *) "new_get_focus", cfg_true, CFGF_NONE), CFG_BOOL((char *) "new_get_focus", cfg_true, CFGF_NONE),
CFG_STR((char *) "font", (char *) "mono-12", CFGF_NONE), CFG_STR((char *) "font", (char *) "mono-12", CFGF_NONE),

View File

@ -143,7 +143,9 @@ restack(int screen)
if(!sel) if(!sel)
return; return;
XRaiseWindow(globalconf.display, sel->win); if(!globalconf.screens[screen].sloppy_focus
|| globalconf.screens[screen].sloppy_focus_raise)
XRaiseWindow(globalconf.display, sel->win);
if(globalconf.screens[screen].focus_move_pointer) if(globalconf.screens[screen].focus_move_pointer)
XWarpPointer(globalconf.display, None, sel->win, 0, 0, 0, 0, XWarpPointer(globalconf.display, None, sel->win, 0, 0, 0, 0,

View File

@ -264,6 +264,8 @@ typedef struct
Bool resize_hints; Bool resize_hints;
/** Sloppy focus: focus follow mouse */ /** Sloppy focus: focus follow mouse */
Bool sloppy_focus; Bool sloppy_focus;
/** True if we should raise windows on focus */
Bool sloppy_focus_raise;
/** Focus new clients */ /** Focus new clients */
Bool new_get_focus; Bool new_get_focus;
/** True if new clients should become master */ /** True if new clients should become master */