client.focus.history.get: use stacking order

This should make it faster in general, and provides a better fallback in
case nothing was found.

Ref: https://github.com/awesomeWM/awesome/pull/526
This commit is contained in:
Daniel Hahler 2015-10-13 12:17:54 +02:00
parent 208db47b2d
commit 3da2508ace
1 changed files with 1 additions and 1 deletions

View File

@ -181,7 +181,7 @@ end
function client.focus.history.get(screen, idx, filter) function client.focus.history.get(screen, idx, filter)
-- When this counter is equal to idx, we return the client -- When this counter is equal to idx, we return the client
local counter = 0 local counter = 0
local vc = client.visible(screen) local vc = client.visible(screen, true)
for k, c in ipairs(client.data.focus) do for k, c in ipairs(client.data.focus) do
if c.screen == screen then if c.screen == screen then
if not filter or filter(c) then if not filter or filter(c) then