diff --git a/config.c b/config.c index 4e3c12876..9368dbf8c 100644 --- a/config.c +++ b/config.c @@ -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_INT((char *) "opacity_unfocused", 100, 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_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->opacity_unfocused = cfg_getint(cfg_general, "opacity_unfocused"); 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")); if(!awesomeconf->font) eprint("awesome: cannot init font\n"); diff --git a/config.h b/config.h index 67239f084..6ef52f608 100644 --- a/config.h +++ b/config.h @@ -169,6 +169,8 @@ struct awesome_config int opacity_unfocused; /** Focus move pointer */ Bool focus_move_pointer; + /** Allow floats to be lowered on focus change */ + Bool allow_lower_floats; /** Respect resize hints */ Bool resize_hints; /** Text displayed in bar */ diff --git a/layout.c b/layout.c index 4c4620975..7df7a1bf8 100644 --- a/layout.c +++ b/layout.c @@ -121,23 +121,28 @@ restack(Display * disp, awesome_config *awesomeconf) drawstatusbar(disp, awesomeconf); if(!*awesomeconf->client_sel) return; - if((*awesomeconf->client_sel)->isfloating || IS_ARRANGE(0, layout_floating)) + if(awesomeconf->allow_lower_floats) XRaiseWindow(disp, (*awesomeconf->client_sel)->win); - if(!IS_ARRANGE(0, layout_floating)) + else { - wc.stack_mode = Below; - wc.sibling = awesomeconf->statusbar.window; - if(!(*awesomeconf->client_sel)->isfloating) + if((*awesomeconf->client_sel)->isfloating || IS_ARRANGE(0, layout_floating)) + XRaiseWindow(disp, (*awesomeconf->client_sel)->win); + if(!IS_ARRANGE(0, layout_floating)) { - XConfigureWindow(disp, (*awesomeconf->client_sel)->win, CWSibling | CWStackMode, &wc); - wc.sibling = (*awesomeconf->client_sel)->win; - } - for(c = *awesomeconf->clients; c; c = c->next) - { - if(!IS_TILED(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags) || c == *awesomeconf->client_sel) - continue; - XConfigureWindow(disp, c->win, CWSibling | CWStackMode, &wc); - wc.sibling = c->win; + wc.stack_mode = Below; + wc.sibling = awesomeconf->statusbar.window; + if(!(*awesomeconf->client_sel)->isfloating) + { + XConfigureWindow(disp, (*awesomeconf->client_sel)->win, CWSibling | CWStackMode, &wc); + wc.sibling = (*awesomeconf->client_sel)->win; + } + for(c = *awesomeconf->clients; c; c = c->next) + { + if(!IS_TILED(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags) || c == *awesomeconf->client_sel) + continue; + XConfigureWindow(disp, c->win, CWSibling | CWStackMode, &wc); + wc.sibling = c->win; + } } } if(awesomeconf->focus_move_pointer)