summaryrefslogtreecommitdiff
path: root/openbox/client.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-09-15 10:54:07 +0000
committerDana Jansens <danakj@orodu.net>2003-09-15 10:54:07 +0000
commit4ccc4c5ed7d5cffc4bf733191f7bc30fbbf069c8 (patch)
treec576a940be5853ac5ec9bde841f797d63e78061c /openbox/client.c
parent17676168255fcf5cbec9ea5dadcee546c5ab7bbb (diff)
break focus. or maybe make it better.
these changes make it work when you alt-tab off a fullscreen window, that it doesnt iconify, and that it is immediately restacked instead of waiting for a FocusIn event to arrive. The code now assumes that if the window says it can focus, that if we focus it, it is focused. add the XDone handler to ObMainLoop, which is fired upon the occurance of there being no more X events to read.
Diffstat (limited to 'openbox/client.c')
-rw-r--r--openbox/client.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/openbox/client.c b/openbox/client.c
index 59af202a..83291132 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -1647,7 +1647,9 @@ static ObStackingLayer calc_layer(ObClient *self)
{
ObStackingLayer l;
- if (self->fullscreen) l = OB_STACKING_LAYER_FULLSCREEN;
+ if (self->fullscreen &&
+ (client_focused(self) || client_search_focus_tree(self)))
+ l = OB_STACKING_LAYER_FULLSCREEN;
else if (self->type == OB_CLIENT_TYPE_DESKTOP)
l = OB_STACKING_LAYER_DESKTOP;
else if (self->type == OB_CLIENT_TYPE_DOCK) {
@@ -1669,7 +1671,9 @@ static void client_calc_layer_recursive(ObClient *self, ObClient *orig,
old = self->layer;
own = calc_layer(self);
- self->layer = l > own ? l : own;
+ self->layer = MAX(l, own);
+
+ g_message("calc for 0x%x %d %d", self->window, old, self->layer);
for (it = self->transients; it; it = it->next)
client_calc_layer_recursive(it->data, orig,
@@ -1677,7 +1681,6 @@ static void client_calc_layer_recursive(ObClient *self, ObClient *orig,
if (!raised && l != old)
if (orig->frame) { /* only restack if the original window is managed */
- /* XXX add_non_intrusive ever? */
stacking_remove(CLIENT_AS_WINDOW(self));
stacking_add(CLIENT_AS_WINDOW(self));
}
@@ -2526,14 +2529,15 @@ gboolean client_focus(ObClient *self)
/* choose the correct target */
self = client_focus_target(self);
- if (!client_can_focus(self)) {
- if (!self->frame->visible) {
- /* update the focus lists */
- focus_order_to_top(self);
- }
+ if (!self->frame->visible) {
+ /* update the focus lists */
+ focus_order_to_top(self);
return FALSE;
}
+ if (!client_can_focus(self))
+ return FALSE;
+
if (self->can_focus) {
/* RevertToPointerRoot causes much more headache than RevertToNone, so
I choose to use it always, hopefully to find errors quicker, if any
@@ -2561,6 +2565,8 @@ gboolean client_focus(ObClient *self)
XSendEvent(ob_display, self->window, FALSE, NoEventMask, &ce);
}
+ focus_set_client(self);
+
#ifdef DEBUG_FOCUS
ob_debug("%sively focusing %lx at %d\n",
(self->can_focus ? "act" : "pass"),