From a67e5023c079a5454a7d4f4592bb471b475b254a Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Thu, 26 Jun 2008 23:42:51 +0200 Subject: [PATCH] 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 Signed-off-by: Julien Danjou --- client.c | 6 ++---- client.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/client.c b/client.c index dae919aa5..08e69ad02 100644 --- a/client.c +++ b/client.c @@ -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. diff --git a/client.h b/client.h index 40336d476..ff7121cf1 100644 --- a/client.h +++ b/client.h @@ -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 *);