awful.screen.focus: Prevent focusing a screen that doesn't exist

Signed-off-by: Christopher Eatinger <christopher.eatinger@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Christopher Eatinger 2009-08-21 14:26:16 -04:00 committed by Julien Danjou
parent 69b4b2650d
commit 933c958220
1 changed files with 1 additions and 0 deletions

View File

@ -23,6 +23,7 @@ data.padding = {}
--- Give the focus to a screen, and move pointer.
-- @param screen Screen number.
function focus(screen)
if screen > capi.screen.count() then screen = capi.mouse.screen end
local c = client.focus.history.get(screen, 0)
if c then capi.client.focus = c end
-- Move the mouse on the screen