always ignore errors for client_focus like we used to.

This commit is contained in:
Dana Jansens 2007-05-15 17:38:52 +00:00
parent d3e524420f
commit d30809e5fa
7 changed files with 15 additions and 20 deletions

View file

@ -1296,7 +1296,7 @@ void action_focus(union ActionData *data)
go moving on us */ go moving on us */
event_halt_focus_delay(); event_halt_focus_delay();
client_focus(data->client.any.c, FALSE); client_focus(data->client.any.c);
} }
} else { } else {
/* focus action on something other than a client, make keybindings /* focus action on something other than a client, make keybindings

View file

@ -2842,7 +2842,7 @@ void client_fullscreen(ObClient *self, gboolean fs)
if (fs) { if (fs) {
/* try focus us when we go into fullscreen mode */ /* try focus us when we go into fullscreen mode */
client_focus(self, FALSE); client_focus(self);
} }
} }
@ -3336,7 +3336,7 @@ gboolean client_can_focus(ObClient *self)
return TRUE; return TRUE;
} }
gboolean client_focus(ObClient *self, gboolean checkinvalid) gboolean client_focus(ObClient *self)
{ {
/* choose the correct target */ /* choose the correct target */
self = client_focus_target(self); self = client_focus_target(self);
@ -3363,8 +3363,7 @@ gboolean client_focus(ObClient *self, gboolean checkinvalid)
if (keyboard_interactively_grabbed()) if (keyboard_interactively_grabbed())
keyboard_interactive_cancel(); keyboard_interactive_cancel();
if (checkinvalid) xerror_set_ignore(TRUE);
xerror_set_ignore(TRUE);
xerror_occured = FALSE; xerror_occured = FALSE;
if (self->can_focus) { if (self->can_focus) {
@ -3389,8 +3388,7 @@ gboolean client_focus(ObClient *self, gboolean checkinvalid)
XSendEvent(ob_display, self->window, FALSE, NoEventMask, &ce); XSendEvent(ob_display, self->window, FALSE, NoEventMask, &ce);
} }
if (checkinvalid) xerror_set_ignore(FALSE);
xerror_set_ignore(FALSE);
return !xerror_occured; return !xerror_occured;
} }
@ -3426,7 +3424,7 @@ static void client_present(ObClient *self, gboolean here, gboolean raise)
if (raise) if (raise)
stacking_raise(CLIENT_AS_WINDOW(self)); stacking_raise(CLIENT_AS_WINDOW(self));
client_focus(self, FALSE); client_focus(self);
} }
void client_activate(ObClient *self, gboolean here, gboolean user) void client_activate(ObClient *self, gboolean here, gboolean user)

View file

@ -531,11 +531,8 @@ ObClient *client_focus_target(ObClient *self);
without focusing it or modifying the focus order lists. */ without focusing it or modifying the focus order lists. */
gboolean client_can_focus(ObClient *self); gboolean client_can_focus(ObClient *self);
/*! Attempt to focus the client window /*! Attempt to focus the client window */
If you care if focus actually went to the window or not, pass checkinvalid gboolean client_focus(ObClient *self);
as TRUE.
*/
gboolean client_focus(ObClient *self, gboolean checkinvalid);
/*! Activates the client for use, focusing, uniconifying it, etc. To be used /*! Activates the client for use, focusing, uniconifying it, etc. To be used
when the user deliberately selects a window for use. when the user deliberately selects a window for use.

View file

@ -1693,7 +1693,7 @@ static gboolean focus_delay_func(gpointer data)
event_curtime = d->time; event_curtime = d->time;
if (focus_client != d->client) { if (focus_client != d->client) {
if (client_focus(d->client, FALSE) && config_focus_raise) if (client_focus(d->client) && config_focus_raise)
stacking_raise(CLIENT_AS_WINDOW(d->client)); stacking_raise(CLIENT_AS_WINDOW(d->client));
} }
event_curtime = old; event_curtime = old;

View file

@ -201,7 +201,7 @@ static ObClient* focus_fallback_target(gboolean allow_refocus)
if ((c = client_under_pointer()) && if ((c = client_under_pointer()) &&
(allow_refocus || c != old) && (allow_refocus || c != old) &&
(client_normal(c) && (client_normal(c) &&
client_focus(c, TRUE))) client_focus(c)))
{ {
ob_debug_type(OB_DEBUG_FOCUS, "found in pointer stuff\n"); ob_debug_type(OB_DEBUG_FOCUS, "found in pointer stuff\n");
return c; return c;
@ -211,7 +211,7 @@ static ObClient* focus_fallback_target(gboolean allow_refocus)
if (allow_refocus && old && if (allow_refocus && old &&
old->desktop == DESKTOP_ALL && old->desktop == DESKTOP_ALL &&
client_normal(old) && client_normal(old) &&
client_focus(old, TRUE)) client_focus(old))
{ {
ob_debug_type(OB_DEBUG_FOCUS, "found in omnipresentness\n"); ob_debug_type(OB_DEBUG_FOCUS, "found in omnipresentness\n");
return old; return old;
@ -231,7 +231,7 @@ static ObClient* focus_fallback_target(gboolean allow_refocus)
if (c->desktop == screen_desktop && if (c->desktop == screen_desktop &&
client_normal(c) && client_normal(c) &&
(allow_refocus || c != old) && (allow_refocus || c != old) &&
client_focus(c, TRUE)) client_focus(c))
{ {
ob_debug_type(OB_DEBUG_FOCUS, "found in focus order\n"); ob_debug_type(OB_DEBUG_FOCUS, "found in focus order\n");
return c; return c;
@ -250,7 +250,7 @@ static ObClient* focus_fallback_target(gboolean allow_refocus)
*/ */
if (c->type == OB_CLIENT_TYPE_DESKTOP && if (c->type == OB_CLIENT_TYPE_DESKTOP &&
(allow_refocus || c != old) && (allow_refocus || c != old) &&
client_focus(c, TRUE)) client_focus(c))
{ {
ob_debug_type(OB_DEBUG_FOCUS, "found a desktop window\n"); ob_debug_type(OB_DEBUG_FOCUS, "found a desktop window\n");
return c; return c;

View file

@ -311,7 +311,7 @@ gint main(gint argc, gchar **argv)
(w = g_hash_table_lookup(window_map, &xid)) && (w = g_hash_table_lookup(window_map, &xid)) &&
WINDOW_IS_CLIENT(w)) WINDOW_IS_CLIENT(w))
{ {
client_focus(WINDOW_AS_CLIENT(w), FALSE); client_focus(WINDOW_AS_CLIENT(w));
} }
} else { } else {
GList *it; GList *it;

View file

@ -942,7 +942,7 @@ void screen_show_desktop(gboolean show, ObClient *show_only)
ObClient *c = it->data; ObClient *c = it->data;
if (c->type == OB_CLIENT_TYPE_DESKTOP && if (c->type == OB_CLIENT_TYPE_DESKTOP &&
(c->desktop == screen_desktop || c->desktop == DESKTOP_ALL) && (c->desktop == screen_desktop || c->desktop == DESKTOP_ALL) &&
client_focus(it->data, FALSE)) client_focus(it->data))
break; break;
} }
} }