yet more changes to choosing to focus windows when they mapp
This commit is contained in:
parent
d22e9c9c1d
commit
5d973d35e8
1 changed files with 15 additions and 3 deletions
|
@ -153,7 +153,6 @@ void client_manage(Window window)
|
||||||
XSetWindowAttributes attrib_set;
|
XSetWindowAttributes attrib_set;
|
||||||
/* XWMHints *wmhint; */
|
/* XWMHints *wmhint; */
|
||||||
guint i;
|
guint i;
|
||||||
Client *parent;
|
|
||||||
|
|
||||||
grab_server(TRUE);
|
grab_server(TRUE);
|
||||||
|
|
||||||
|
@ -241,9 +240,21 @@ void client_manage(Window window)
|
||||||
|
|
||||||
/* focus the new window? */
|
/* focus the new window? */
|
||||||
if (ob_state != State_Starting) {
|
if (ob_state != State_Starting) {
|
||||||
|
Client *parent;
|
||||||
|
gboolean group_foc = FALSE;
|
||||||
|
|
||||||
parent = NULL;
|
parent = NULL;
|
||||||
|
|
||||||
if (self->transient_for) {
|
if (self->group) {
|
||||||
|
GSList *it;
|
||||||
|
|
||||||
|
for (it = self->group->members; it; it = it->next)
|
||||||
|
if (client_focused(it->data)) {
|
||||||
|
group_foc = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!group_foc && self->transient_for) {
|
||||||
if (self->transient_for != TRAN_GROUP) {/* transient of a window */
|
if (self->transient_for != TRAN_GROUP) {/* transient of a window */
|
||||||
parent = self->transient_for;
|
parent = self->transient_for;
|
||||||
} else { /* transient of a group */
|
} else { /* transient of a group */
|
||||||
|
@ -260,7 +271,8 @@ void client_manage(Window window)
|
||||||
rules for focus */
|
rules for focus */
|
||||||
if ((config_focus_new &&
|
if ((config_focus_new &&
|
||||||
(self->type == Type_Normal ||
|
(self->type == Type_Normal ||
|
||||||
(self->type == Type_Dialog && !parent && !self->group))) ||
|
(self->type == Type_Dialog && (group_foc ||
|
||||||
|
(!parent && !self->group))))) ||
|
||||||
(parent && (client_focused(parent) ||
|
(parent && (client_focused(parent) ||
|
||||||
search_focus_tree(parent, parent)))) {
|
search_focus_tree(parent, parent)))) {
|
||||||
client_focus(self);
|
client_focus(self);
|
||||||
|
|
Loading…
Reference in a new issue