mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
screen: move screen.focus to awful
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
81ae462a70
commit
4016877ad4
2 changed files with 2 additions and 19 deletions
|
@ -173,7 +173,8 @@ function P.screen.focus(i)
|
|||
s = mouse.screen
|
||||
end
|
||||
s = cycle(screen.count(), s + i)
|
||||
screen.focus(s)
|
||||
local vc = client.visible_get(s)
|
||||
if #vc > 0 then vc[1]:focus_set() end
|
||||
-- Move the mouse on the screen
|
||||
mouse.coords = screen.coords_get(s)
|
||||
end
|
||||
|
|
18
lua.c
18
lua.c
|
@ -169,23 +169,6 @@ luaA_screen_count(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/** Give the focus to a screen.
|
||||
* \param L The Lua VM state.
|
||||
* \return The number of elements pushed on stack.
|
||||
*
|
||||
* \luastack
|
||||
* \lparam A screen number
|
||||
*/
|
||||
static int
|
||||
luaA_screen_focus(lua_State *L)
|
||||
{
|
||||
/* Our table begin at 0, Lua begins at 1 */
|
||||
int screen = luaL_checknumber(L, 1) - 1;
|
||||
luaA_checkscreen(screen);
|
||||
client_focus(NULL, screen);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Return screen coordinates.
|
||||
* \param L The Lua VM state.
|
||||
* \return The number of elements pushed on stack.
|
||||
|
@ -476,7 +459,6 @@ luaA_init(void)
|
|||
{ "coords_get", luaA_screen_coords_get },
|
||||
{ "workspace_get", luaA_screen_workspace_get },
|
||||
{ "count", luaA_screen_count },
|
||||
{ "focus", luaA_screen_focus },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
static const struct luaL_reg awesome_hooks_lib[] =
|
||||
|
|
Loading…
Reference in a new issue