If awesome believes we have the focus, well, do not unfocus ourselves.

This avoid flickering when you repeteadly click on a client.
Also make the function client_focus void, it always returned true, and
nobody cares about the result.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Pierre Habouzit 2008-06-26 23:42:51 +02:00 committed by Julien Danjou
parent 4bf6d2df62
commit a67e5023c0
2 changed files with 3 additions and 5 deletions

View File

@ -217,7 +217,7 @@ client_ban(client_t *c)
* \param screen Virtual screen number.
* \return True if a window (even root) has received focus, false otherwise.
*/
bool
void
client_focus(client_t *c, int screen)
{
int phys_screen;
@ -229,7 +229,7 @@ client_focus(client_t *c, int screen)
for(c = globalconf.clients; c && (c->skip || !client_isvisible(c, screen)); c = c->next);
/* unfocus current selected client */
if(globalconf.focus->client)
if(globalconf.focus->client && c != globalconf.focus->client)
client_unfocus(globalconf.focus->client);
if(c)
@ -260,8 +260,6 @@ client_focus(client_t *c, int screen)
ewmh_update_net_active_window(phys_screen);
widget_invalidate_cache(screen, WIDGET_CACHE_CLIENTS);
return true;
}
/** Restack clients and puts c in top of its layer.

View File

@ -28,7 +28,7 @@
bool client_isvisible(client_t *, int);
client_t * client_getbywin(xcb_window_t);
bool client_focus(client_t *, int);
void client_focus(client_t *, int);
void client_setlayer(client_t *, layer_t);
void client_raise(client_t *);
void client_ban(client_t *);