diff --git a/lib/awful/screen.lua.in b/lib/awful/screen.lua.in index 0a03f74f5..8f6049d07 100644 --- a/lib/awful/screen.lua.in +++ b/lib/awful/screen.lua.in @@ -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