From a4c7ffffc7cf8c2abbd9f84ddf30b03333640629 Mon Sep 17 00:00:00 2001 From: Arnaud Fontaine Date: Sun, 11 May 2008 17:41:04 +0100 Subject: [PATCH] [client] Add client_redraw (FS#170) --- awesome.1.txt | 2 ++ awesomerc.in | 1 + client.c | 13 +++++++++++++ client.h | 1 + uicb.c | 1 + 5 files changed, 18 insertions(+) diff --git a/awesome.1.txt b/awesome.1.txt index 5f8433a50..2b213bee3 100644 --- a/awesome.1.txt +++ b/awesome.1.txt @@ -125,6 +125,8 @@ DEFAULTS KEY BINDINGS Zoom client. *Mod4 \+ Control \+ space*:: Set client floating. +*Mod4 \+ s*:: + Redraw the client. *Mod4 \+ Shift \+ c*:: Kill client. *Mod4 \+ Shift \+ q*:: diff --git a/awesomerc.in b/awesomerc.in index 5e00b8f10..812c95b69 100644 --- a/awesomerc.in +++ b/awesomerc.in @@ -129,6 +129,7 @@ keys key { modkey = {"Mod4", "Control"} key = "space" command = "client_setfloating" } key { modkey = {"Mod4"} key = "s" command = "client_togglescratch" } key { modkey = {"Mod4", "Control"} key = "s" command = "client_setscratch" } + key { modkey = {"Mod4"} key = "r" command = "client_redraw" } key { modkey = {"Mod4", "Shift"} key = "c" command = "client_kill" } key { modkey = {"Mod4", "Shift"} key = "q" command = "quit" } key { modkey = {"Mod4", "Control"} key = "r" command = "restart" } diff --git a/client.c b/client.c index 9eab2bc3b..59aaec893 100644 --- a/client.c +++ b/client.c @@ -1244,6 +1244,19 @@ uicb_client_setscratch(int screen, char *arg __attribute__ ((unused))) globalconf.screens[screen].need_arrange = true; } +void +uicb_client_redraw(int screen __attribute__ ((unused)), + char *arg __attribute__ ((unused))) +{ + if(!globalconf.focus->client) + return; + + /* Use unmap/map ATM but it would be better to used SendEvent, + * however the client doesn't seem to handle it... */ + xcb_unmap_window(globalconf.connection, globalconf.focus->client->win); + xcb_map_window(globalconf.connection, globalconf.focus->client->win); +} + /** Toggle the scratch client's visibility. * \param screen screen number * \param arg unused argument diff --git a/client.h b/client.h index 5eebbbee5..47352a960 100644 --- a/client.h +++ b/client.h @@ -54,6 +54,7 @@ uicb_t uicb_client_focus; uicb_t uicb_client_setfloating; uicb_t uicb_client_togglescratch; uicb_t uicb_client_setscratch; +uicb_t uicb_client_redraw; DO_SLIST(client_t, client, p_delete) diff --git a/uicb.c b/uicb.c index 057fa5abc..cc8bd6883 100644 --- a/uicb.c +++ b/uicb.c @@ -58,6 +58,7 @@ const name_func_link_t UicbList[] = { "client_setfloating", uicb_client_setfloating }, { "client_togglescratch", uicb_client_togglescratch }, { "client_setscratch", uicb_client_setscratch }, + { "client_redraw", uicb_client_redraw }, /* focus.h */ { "focus_history", uicb_focus_history }, { "focus_client_byname", uicb_focus_client_byname },