float lowering

This commit is contained in:
Nikos Ntarmos 2007-10-12 17:03:18 +03:00 committed by Julien Danjou
parent a6781157b6
commit 23bbe21428
3 changed files with 23 additions and 14 deletions

View File

@ -147,6 +147,7 @@ parse_config(Display * disp, int scr,const char *confpatharg, awesome_config *aw
CFG_BOOL((char *) "resize_hints", cfg_false, CFGF_NONE), CFG_BOOL((char *) "resize_hints", cfg_false, CFGF_NONE),
CFG_INT((char *) "opacity_unfocused", 100, CFGF_NONE), CFG_INT((char *) "opacity_unfocused", 100, 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 *) "allow_lower_floats", cfg_false, CFGF_NONE),
CFG_STR((char *) "font", (char *) "mono-12", CFGF_NONE), CFG_STR((char *) "font", (char *) "mono-12", CFGF_NONE),
CFG_END() CFG_END()
}; };
@ -276,6 +277,7 @@ parse_config(Display * disp, int scr,const char *confpatharg, awesome_config *aw
awesomeconf->resize_hints = cfg_getbool(cfg_general, "resize_hints"); awesomeconf->resize_hints = cfg_getbool(cfg_general, "resize_hints");
awesomeconf->opacity_unfocused = cfg_getint(cfg_general, "opacity_unfocused"); awesomeconf->opacity_unfocused = cfg_getint(cfg_general, "opacity_unfocused");
awesomeconf->focus_move_pointer = cfg_getbool(cfg_general, "focus_move_pointer"); awesomeconf->focus_move_pointer = cfg_getbool(cfg_general, "focus_move_pointer");
awesomeconf->allow_lower_floats = cfg_getbool(cfg_general, "allow_lower_floats");
awesomeconf->font = XftFontOpenName(disp, awesomeconf->phys_screen, cfg_getstr(cfg_general, "font")); awesomeconf->font = XftFontOpenName(disp, awesomeconf->phys_screen, cfg_getstr(cfg_general, "font"));
if(!awesomeconf->font) if(!awesomeconf->font)
eprint("awesome: cannot init font\n"); eprint("awesome: cannot init font\n");

View File

@ -169,6 +169,8 @@ struct awesome_config
int opacity_unfocused; int opacity_unfocused;
/** Focus move pointer */ /** Focus move pointer */
Bool focus_move_pointer; Bool focus_move_pointer;
/** Allow floats to be lowered on focus change */
Bool allow_lower_floats;
/** Respect resize hints */ /** Respect resize hints */
Bool resize_hints; Bool resize_hints;
/** Text displayed in bar */ /** Text displayed in bar */

View File

@ -121,6 +121,10 @@ restack(Display * disp, awesome_config *awesomeconf)
drawstatusbar(disp, awesomeconf); drawstatusbar(disp, awesomeconf);
if(!*awesomeconf->client_sel) if(!*awesomeconf->client_sel)
return; return;
if(awesomeconf->allow_lower_floats)
XRaiseWindow(disp, (*awesomeconf->client_sel)->win);
else
{
if((*awesomeconf->client_sel)->isfloating || IS_ARRANGE(0, layout_floating)) if((*awesomeconf->client_sel)->isfloating || IS_ARRANGE(0, layout_floating))
XRaiseWindow(disp, (*awesomeconf->client_sel)->win); XRaiseWindow(disp, (*awesomeconf->client_sel)->win);
if(!IS_ARRANGE(0, layout_floating)) if(!IS_ARRANGE(0, layout_floating))
@ -140,6 +144,7 @@ restack(Display * disp, awesome_config *awesomeconf)
wc.sibling = c->win; wc.sibling = c->win;
} }
} }
}
if(awesomeconf->focus_move_pointer) if(awesomeconf->focus_move_pointer)
XWarpPointer(disp, None, (*awesomeconf->client_sel)->win, 0, 0, 0, 0, (*awesomeconf->client_sel)->w / 2, (*awesomeconf->client_sel)->h / 2); XWarpPointer(disp, None, (*awesomeconf->client_sel)->win, 0, 0, 0, 0, (*awesomeconf->client_sel)->w / 2, (*awesomeconf->client_sel)->h / 2);
XSync(disp, False); XSync(disp, False);