diff --git a/awesome.1.txt b/awesome.1.txt index 740cd326..14f7a195 100644 --- a/awesome.1.txt +++ b/awesome.1.txt @@ -154,6 +154,9 @@ Misc *Mod4 \+ Shift \+ i*:: Print the client class and instance. +*Mod4 \+ Shift \+ r*:: + Redraw the focused window. + CUSTOMIZATION ------------- *awesome* is customized by creating a custom '$XDG_CONFIG_HOME/awesome/rc.lua' file. diff --git a/awesomerc.lua.in b/awesomerc.lua.in index 0bd65254..1c897657 100644 --- a/awesomerc.lua.in +++ b/awesomerc.lua.in @@ -224,6 +224,7 @@ keybinding({ modkey, "Control" }, "Return", function () client.focus:swap(awful. keybinding({ modkey }, "o", awful.client.movetoscreen):add() keybinding({ modkey }, "Tab", awful.client.focus.history.previous):add() keybinding({ modkey }, "u", awful.client.urgent.jumpto):add() +keybinding({ modkey, "Shift" }, "r", function () client.focus:redraw() end):add() -- Layout manipulation keybinding({ modkey }, "l", function () awful.tag.incmwfact(0.05) end):add() diff --git a/client.c b/client.c index 1bdc4073..c3d34e9d 100644 --- a/client.c +++ b/client.c @@ -1068,8 +1068,17 @@ static int luaA_client_redraw(lua_State *L) { client_t **c = luaA_checkudata(L, 1, "client"); + xcb_unmap_window(globalconf.connection, (*c)->win); xcb_map_window(globalconf.connection, (*c)->win); + + /* Set the focus on the current window if the redraw has been + performed on the window where the pointer is currently on + because after the unmapping/mapping, the focus is lost */ + if(globalconf.screen_focus->client_focus == *c) + xcb_set_input_focus(globalconf.connection, XCB_INPUT_FOCUS_POINTER_ROOT, + (*c)->win, XCB_CURRENT_TIME); + return 0; }