summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-04-18 04:13:08 +0000
committerDana Jansens <danakj@orodu.net>2003-04-18 04:13:08 +0000
commitc4fb053f2fe774d3cbf17b10d761666b3c85a60f (patch)
tree0735e2cbafa6803b1dfae1bb4cc9077bf3019e69 /openbox
parente6a00eee317a04b14fda4563e0563812d2b1896b (diff)
more strict rules on what will be focused by the focusNew option in the rc3. only strictly NORMAL windows will be focused, not dialogs or anything else when they are mapped.
Diffstat (limited to 'openbox')
-rw-r--r--openbox/client.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/openbox/client.c b/openbox/client.c
index da3a8e32..dd1f9642 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -153,6 +153,7 @@ void client_manage(Window window)
XSetWindowAttributes attrib_set;
/* XWMHints *wmhint; */
guint i;
+ gboolean f;
grab_server(TRUE);
@@ -240,22 +241,30 @@ void client_manage(Window window)
/* focus the new window? */
if (ob_state != State_Starting && client_normal(self)) {
- if (config_focus_new)
- client_focus(self);
- else if (self->transient_for) {
+ f = FALSE;
+
+ if (self->transient_for) {
if (self->transient_for != TRAN_GROUP) {/* transient of a window */
- if (focus_client == self->transient_for)
+ if (focus_client == self->transient_for) {
client_focus(self);
+ f = TRUE;
+ }
} else { /* transient of a group */
GSList *it;
for (it = self->group->members; it; it = it->next)
if (focus_client == it->data) {
client_focus(self);
+ f = TRUE;
break;
}
}
}
+ /* note the check against Type_Normal, not client_normal(self), which
+ would also include dialog types. in this case we want more strict
+ rules for focus */
+ if (!f && config_focus_new && self->type == Type_Normal)
+ client_focus(self);
}
/* update the list hints */