fallback is still getting x errors. instead, fallback when the client iconifies, and don't fallback when nothing has focus, send it to where we can control things though.

This commit is contained in:
Dana Jansens 2007-03-12 17:31:11 +00:00
parent dc41c78a90
commit d47c6a0979
2 changed files with 8 additions and 3 deletions

View file

@ -2426,6 +2426,10 @@ static void client_iconify_recursive(ObClient *self,
bottom'. */ bottom'. */
focus_order_to_top(self); focus_order_to_top(self);
/* Fall back focus since we're disappearing */
if (focus_client == self)
client_unfocus(self);
changed = TRUE; changed = TRUE;
} }
} else { } else {
@ -2992,8 +2996,9 @@ gboolean client_focus(ObClient *self)
return TRUE; return TRUE;
} }
/* Used when the current client is closed, focus_last will then prevent /* Used when the current client is closed or otherwise hidden, focus_last will
* focus from going to the mouse pointer */ then prevent focus from going to the mouse pointer
*/
void client_unfocus(ObClient *self) void client_unfocus(ObClient *self)
{ {
if (focus_client == self) { if (focus_client == self) {

View file

@ -664,7 +664,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
/* Look for the followup FocusIn */ /* Look for the followup FocusIn */
if (!XCheckIfEvent(ob_display, &ce, look_for_focusin, NULL)) { if (!XCheckIfEvent(ob_display, &ce, look_for_focusin, NULL)) {
/* There is no FocusIn, move focus where we can still hear events*/ /* There is no FocusIn, move focus where we can still hear events*/
focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS); focus_set_client(NULL);
} else if (ce.xany.window == e->xany.window) { } else if (ce.xany.window == e->xany.window) {
/* If focus didn't actually move anywhere, there is nothing to do*/ /* If focus didn't actually move anywhere, there is nothing to do*/
break; break;