add new_get_focus option

This commit is contained in:
Julien Danjou 2008-01-07 18:54:45 +01:00
parent cf6305570e
commit c2ca948b39
4 changed files with 11 additions and 3 deletions

View File

@ -176,6 +176,8 @@ client_updatetitle(Client *c)
{
if(!xgettextprop(c->win, XInternAtom(globalconf.display, "_NET_WM_NAME", False), c->name, sizeof(c->name)))
xgettextprop(c->win, XInternAtom(globalconf.display, "WM_NAME", False), c->name, sizeof(c->name));
widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS);
}
/** Ban client and unmap it
@ -419,7 +421,10 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
XMoveResizeWindow(globalconf.display, c->win, c->geometry.x, c->geometry.y,
c->geometry.width, c->geometry.height);
if(globalconf.screens[c->screen].new_get_focus)
focus(c, True, screen);
else
widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS);
ewmh_update_net_client_list(phys_screen);

View File

@ -347,6 +347,7 @@ config_parse_screen(cfg_t *cfg, int screen)
virtscreen->allow_lower_floats = cfg_getbool(cfg_general, "allow_lower_floats");
virtscreen->sloppy_focus = cfg_getbool(cfg_general, "sloppy_focus");
virtscreen->new_become_master = cfg_getbool(cfg_general, "new_become_master");
virtscreen->new_get_focus = cfg_getbool(cfg_general, "new_get_focus");
virtscreen->font = XftFontOpenName(globalconf.display,
phys_screen,
cfg_getstr(cfg_general, "font"));
@ -481,6 +482,7 @@ config_parse(const char *confpatharg)
CFG_BOOL((char *) "allow_lower_floats", cfg_false, CFGF_NONE),
CFG_BOOL((char *) "sloppy_focus", 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_STR((char *) "font", (char *) "mono-12", CFGF_NONE),
CFG_END()
};

View File

@ -256,6 +256,8 @@ typedef struct
Bool resize_hints;
/** Sloppy focus: focus follow mouse */
Bool sloppy_focus;
/** Focus new clients */
Bool new_get_focus;
/** True if new clients should become master */
Bool new_become_master;
/** Normal colors */

View File

@ -251,8 +251,6 @@ move_client_to_screen(Client *c, int new_screen, Bool doresize)
arrange(c->screen);
}
}
focus(c, True, c->screen);
}
/** Move mouse pointer to x_org and y_xorg of specified screen
@ -331,5 +329,6 @@ uicb_client_movetoscreen(int screen __attribute__ ((unused)), char *arg)
move_mouse_pointer_to_screen(new_screen);
arrange(prev_screen);
arrange(new_screen);
focus(sel, True, sel->screen);
}
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80