summaryrefslogtreecommitdiff
path: root/openbox/client.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-04-10 06:29:43 +0000
committerDana Jansens <danakj@orodu.net>2003-04-10 06:29:43 +0000
commite9d875cf832f01b60be51270c7a95f2394924f52 (patch)
treee9249c3b017e58488229024c8481a5972816ca43 /openbox/client.c
parentb3ed490e8f4c438535a2cf6be1600242e1031440 (diff)
some smarter rules for focusing new window when focus_new is not set
Diffstat (limited to 'openbox/client.c')
-rw-r--r--openbox/client.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/openbox/client.c b/openbox/client.c
index af24d921..787f84c2 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -238,8 +238,25 @@ void client_manage(Window window)
dispatch_client(Event_Client_Mapped, self, 0, 0);
- if (ob_state != State_Starting && config_focus_new)
- client_focus(self);
+ /* focus the new window? */
+ if (ob_state != State_Starting) {
+ if (config_focus_new)
+ client_focus(self);
+ else if (self->transient_for) {
+ if (self->transient_for != TRAN_GROUP) {/* transient of a window */
+ if (focus_client == self->transient_for)
+ client_focus(self);
+ } else { /* transient of a group */
+ GSList *it;
+
+ for (it = self->group->members; it; it = it->next)
+ if (focus_client == it->data) {
+ client_focus(self);
+ break;
+ }
+ }
+ }
+ }
/* update the list hints */
client_set_list();