From e3c24c8e09c28ff9dd95b242802fc3b6e5d0fe73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Lepage=20Vall=C3=A9e?= Date: Thu, 11 Aug 2016 13:03:17 -0400 Subject: [PATCH] Revert "screen: Fix potential nil index" (#1037) This reverts commit facf676b1367e6915235a45ce3e7ef11790b0411. 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 --- lib/awful/screen.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/awful/screen.lua b/lib/awful/screen.lua index 253bd7bec..b75e46662 100644 --- a/lib/awful/screen.lua +++ b/lib/awful/screen.lua @@ -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