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:
parent
69b4b2650d
commit
933c958220
|
@ -23,6 +23,7 @@ data.padding = {}
|
||||||
--- Give the focus to a screen, and move pointer.
|
--- Give the focus to a screen, and move pointer.
|
||||||
-- @param screen Screen number.
|
-- @param screen Screen number.
|
||||||
function focus(screen)
|
function focus(screen)
|
||||||
|
if screen > capi.screen.count() then screen = capi.mouse.screen end
|
||||||
local c = client.focus.history.get(screen, 0)
|
local c = client.focus.history.get(screen, 0)
|
||||||
if c then capi.client.focus = c end
|
if c then capi.client.focus = c end
|
||||||
-- Move the mouse on the screen
|
-- Move the mouse on the screen
|
||||||
|
|
Loading…
Reference in New Issue