summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-26 14:56:53 +0000
committerDana Jansens <danakj@orodu.net>2007-05-26 14:56:53 +0000
commit7d164842e0d0c3138401fad0dafc6f21bba0a04f (patch)
tree5e5bbcbb9b5dd51a5e2bcf4213569d091e787792
parentac175e47f92ffdb6809405ec80f6e3576a2f9292 (diff)
give focus to new windows when *any* relative already has focus..
don't give it when it will not go to the window anyway tho, like if there is already a modal child for it
-rw-r--r--openbox/client.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/openbox/client.c b/openbox/client.c
index d0cb1934..d94afccf 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -348,7 +348,7 @@ void client_manage(Window window)
!self->iconic &&
/* this means focus=true for window is same as config_focus_new=true */
((config_focus_new || (settings && settings->focus == 1)) ||
- client_search_focus_parent(self)) &&
+ client_search_focus_tree_full(self)) &&
/* this checks for focus=false for the window */
(!settings || settings->focus != 0) &&
/* note the check against Type_Normal/Dialog, not client_normal(self),
@@ -474,8 +474,8 @@ void client_manage(Window window)
"Not focusing the window because its on another "
"desktop\n");
}
- /* If something is focused, and it's not our parent... */
- else if (focus_client && client_search_focus_parent(self) == NULL)
+ /* If something is focused, and it's not our relative... */
+ else if (focus_client && client_search_focus_tree_full(self) == NULL)
{
/* If time stamp is old, don't steal focus */
if (self->user_time && last_time &&
@@ -509,6 +509,14 @@ void client_manage(Window window)
"Not focusing the window because a globally "
"active client has focus\n");
}
+ /* Don't move focus if it's not going to go to this window
+ anyway */
+ else if (client_focus_target(self) != self) {
+ activate = FALSE;
+ ob_debug_type(OB_DEBUG_FOCUS,
+ "Not focusing the window because another window "
+ "would get the focus anyway\n");
+ }
}
if (!activate) {