Revert "screen: Fix potential nil index" (#1037)

This reverts commit facf676b13.

Using capi.client.focus.screen to decide which screen is focused breaks
a multiscreen setup. At least makes it extremely annoying to use.

In particular, if you have a focused client on screen 1, move the mouse
to screen 2 and launch a new client, the new client appears in screen 1,
since screen.focused reports that current focused screen is 1, not 2
because of the focused client.

Close #1035
Fix #1029
This commit is contained in:
Emmanuel Lepage Vallée 2016-08-11 13:03:17 -04:00 committed by Daniel Hahler
parent 03dc4767d5
commit e3c24c8e09
1 changed files with 1 additions and 3 deletions

View File

@ -231,9 +231,7 @@ end
function screen.focused(args)
args = args or screen.default_focused_args or {}
return get_screen(
(args.client and args.client.screen) or
(capi.client.focus and capi.client.focus.screen) or
capi.mouse.screen
args.client and capi.client.focus and capi.client.focus.screen or capi.mouse.screen
)
end