add new_get_focus option
This commit is contained in:
parent
cf6305570e
commit
c2ca948b39
5
client.c
5
client.c
|
@ -176,6 +176,8 @@ client_updatetitle(Client *c)
|
||||||
{
|
{
|
||||||
if(!xgettextprop(c->win, XInternAtom(globalconf.display, "_NET_WM_NAME", False), c->name, sizeof(c->name)))
|
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));
|
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
|
/** 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,
|
XMoveResizeWindow(globalconf.display, c->win, c->geometry.x, c->geometry.y,
|
||||||
c->geometry.width, c->geometry.height);
|
c->geometry.width, c->geometry.height);
|
||||||
|
|
||||||
|
if(globalconf.screens[c->screen].new_get_focus)
|
||||||
focus(c, True, screen);
|
focus(c, True, screen);
|
||||||
|
else
|
||||||
|
widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS);
|
||||||
|
|
||||||
ewmh_update_net_client_list(phys_screen);
|
ewmh_update_net_client_list(phys_screen);
|
||||||
|
|
||||||
|
|
2
config.c
2
config.c
|
@ -347,6 +347,7 @@ config_parse_screen(cfg_t *cfg, int screen)
|
||||||
virtscreen->allow_lower_floats = cfg_getbool(cfg_general, "allow_lower_floats");
|
virtscreen->allow_lower_floats = cfg_getbool(cfg_general, "allow_lower_floats");
|
||||||
virtscreen->sloppy_focus = cfg_getbool(cfg_general, "sloppy_focus");
|
virtscreen->sloppy_focus = cfg_getbool(cfg_general, "sloppy_focus");
|
||||||
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->font = XftFontOpenName(globalconf.display,
|
virtscreen->font = XftFontOpenName(globalconf.display,
|
||||||
phys_screen,
|
phys_screen,
|
||||||
cfg_getstr(cfg_general, "font"));
|
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 *) "allow_lower_floats", 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 *) "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_STR((char *) "font", (char *) "mono-12", CFGF_NONE),
|
CFG_STR((char *) "font", (char *) "mono-12", CFGF_NONE),
|
||||||
CFG_END()
|
CFG_END()
|
||||||
};
|
};
|
||||||
|
|
2
config.h
2
config.h
|
@ -256,6 +256,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;
|
||||||
|
/** Focus new clients */
|
||||||
|
Bool new_get_focus;
|
||||||
/** True if new clients should become master */
|
/** True if new clients should become master */
|
||||||
Bool new_become_master;
|
Bool new_become_master;
|
||||||
/** Normal colors */
|
/** Normal colors */
|
||||||
|
|
3
screen.c
3
screen.c
|
@ -251,8 +251,6 @@ move_client_to_screen(Client *c, int new_screen, Bool doresize)
|
||||||
arrange(c->screen);
|
arrange(c->screen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
focus(c, True, c->screen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Move mouse pointer to x_org and y_xorg of specified 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);
|
move_mouse_pointer_to_screen(new_screen);
|
||||||
arrange(prev_screen);
|
arrange(prev_screen);
|
||||||
arrange(new_screen);
|
arrange(new_screen);
|
||||||
|
focus(sel, True, sel->screen);
|
||||||
}
|
}
|
||||||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||||
|
|
Loading…
Reference in New Issue