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:
parent
4bf6d2df62
commit
a67e5023c0
6
client.c
6
client.c
|
@ -217,7 +217,7 @@ client_ban(client_t *c)
|
||||||
* \param screen Virtual screen number.
|
* \param screen Virtual screen number.
|
||||||
* \return True if a window (even root) has received focus, false otherwise.
|
* \return True if a window (even root) has received focus, false otherwise.
|
||||||
*/
|
*/
|
||||||
bool
|
void
|
||||||
client_focus(client_t *c, int screen)
|
client_focus(client_t *c, int screen)
|
||||||
{
|
{
|
||||||
int phys_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);
|
for(c = globalconf.clients; c && (c->skip || !client_isvisible(c, screen)); c = c->next);
|
||||||
|
|
||||||
/* unfocus current selected client */
|
/* unfocus current selected client */
|
||||||
if(globalconf.focus->client)
|
if(globalconf.focus->client && c != globalconf.focus->client)
|
||||||
client_unfocus(globalconf.focus->client);
|
client_unfocus(globalconf.focus->client);
|
||||||
|
|
||||||
if(c)
|
if(c)
|
||||||
|
@ -260,8 +260,6 @@ client_focus(client_t *c, int screen)
|
||||||
|
|
||||||
ewmh_update_net_active_window(phys_screen);
|
ewmh_update_net_active_window(phys_screen);
|
||||||
widget_invalidate_cache(screen, WIDGET_CACHE_CLIENTS);
|
widget_invalidate_cache(screen, WIDGET_CACHE_CLIENTS);
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Restack clients and puts c in top of its layer.
|
/** Restack clients and puts c in top of its layer.
|
||||||
|
|
2
client.h
2
client.h
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
bool client_isvisible(client_t *, int);
|
bool client_isvisible(client_t *, int);
|
||||||
client_t * client_getbywin(xcb_window_t);
|
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_setlayer(client_t *, layer_t);
|
||||||
void client_raise(client_t *);
|
void client_raise(client_t *);
|
||||||
void client_ban(client_t *);
|
void client_ban(client_t *);
|
||||||
|
|
Loading…
Reference in New Issue