From 85e5baa4b169949dbef6a8ff338a09b8a6b76639 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 8 Feb 2008 15:08:42 +0100 Subject: [PATCH] focus scratch window when it appears, and don't select it for focusing in history --- client.c | 6 +++++- focus.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client.c b/client.c index c684ee99f..f8370ebe6 100644 --- a/client.c +++ b/client.c @@ -191,6 +191,8 @@ client_focus(Client *c, int screen, Bool from_mouse) if(c) { + /* unban the client before focusing or it will fail */ + client_unban(c); /* save sel in focus history */ focus_add_client(c); if(globalconf.screens[c->screen].opacity_unfocused != -1) @@ -1108,12 +1110,14 @@ uicb_client_setscratch(int screen, * \ingroup ui_callback */ void -uicb_client_togglescratch(int screen __attribute__ ((unused)), +uicb_client_togglescratch(int screen, char *arg __attribute__ ((unused))) { if(globalconf.scratch.client) { globalconf.scratch.isvisible = !globalconf.scratch.isvisible; + if(globalconf.scratch.isvisible) + client_focus(globalconf.scratch.client, screen, False); globalconf.screens[globalconf.scratch.client->screen].need_arrange = True; widget_invalidate_cache(globalconf.scratch.client->screen, WIDGET_CACHE_CLIENTS); } diff --git a/focus.c b/focus.c index ac0fed1f4..bc066be30 100644 --- a/focus.c +++ b/focus.c @@ -74,7 +74,7 @@ focus_get_latest_client_for_tags(Tag **t, int nindex) int i = 0; for(node = globalconf.focus; node; node = node->next) - if(node->client && !node->client->skip) + if(node->client && !node->client->skip && node->client != globalconf.scratch.client) for(tags = t; *tags; tags++) if(is_client_tagged(node->client, *tags)) {