diff --git a/lib/awful/client.lua b/lib/awful/client.lua index 3d17b38b..9da7b44c 100644 --- a/lib/awful/client.lua +++ b/lib/awful/client.lua @@ -536,7 +536,7 @@ function client.object.move_to_screen(self, s) end s = get_screen(s) if get_screen(self.screen) ~= s then - local sel_is_focused = self == capi.client.focus + local sel_is_focused = self.active self.screen = s screen.focus(s) diff --git a/lib/awful/titlebar.lua b/lib/awful/titlebar.lua index 0300c77a..d1a4070c 100644 --- a/lib/awful/titlebar.lua +++ b/lib/awful/titlebar.lua @@ -443,7 +443,7 @@ local all_titlebars = setmetatable({}, { __mode = 'k' }) -- Get a color for a titlebar, this tests many values from the array and the theme local function get_color(name, c, args) local suffix = "_normal" - if capi.client.focus == c then + if c.active then suffix = "_focus" end local function get(array) @@ -707,7 +707,7 @@ function titlebar.widget.button(c, name, selector, action) end end local prefix = "normal" - if capi.client.focus == c then + if c.active then prefix = "focus" end if img ~= "" then diff --git a/lib/awful/widget/tasklist.lua b/lib/awful/widget/tasklist.lua index 48e2adf7..3c59d5db 100644 --- a/lib/awful/widget/tasklist.lua +++ b/lib/awful/widget/tasklist.lua @@ -352,7 +352,7 @@ local function tasklist_label(c, args, tb) end end - local focused = capi.client.focus == c + local focused = c.active -- Handle transient_for: the first parent that does not skip the taskbar -- is considered to be focused, if the real client has skip_taskbar. if not focused and capi.client.focus and capi.client.focus.skip_taskbar @@ -723,7 +723,7 @@ end -- @filterfunction awful.tasklist.filter.focused function tasklist.filter.focused(c, screen) -- Only print client on the same screen as this widget - return get_screen(c.screen) == get_screen(screen) and capi.client.focus == c + return get_screen(c.screen) == get_screen(screen) and c.active end --- Get all the clients in an undefined order. diff --git a/tests/test-awful-client.lua b/tests/test-awful-client.lua index 92c423ff..8f3db43d 100644 --- a/tests/test-awful-client.lua +++ b/tests/test-awful-client.lua @@ -133,7 +133,7 @@ table.insert(steps, function() c1, c2 = client.get()[1], client.get()[2] -- This should still be the case - assert(client.focus == c1) + assert(c1.active) c2:emit_signal("request::activate", "i_said_so") @@ -143,7 +143,7 @@ end) -- Check if writing a focus stealing filter works. table.insert(steps, function() -- This should still be the case - assert(client.focus == c2) + assert(c2.active) original_count = #awful.ewmh.generic_activate_filters @@ -158,7 +158,7 @@ end) table.insert(steps, function() -- The request should have been denied - assert(client.focus == c2) + assert(c2.active) -- Test the remove function awful.ewmh.remove_activate_filter(function() end) @@ -171,7 +171,7 @@ table.insert(steps, function() c1:emit_signal("request::activate", "i_said_so") - return client.focus == c1 + return c1.active end) local has_error diff --git a/tests/test-awful-tag.lua b/tests/test-awful-tag.lua index 688ddd48..14d493ed 100644 --- a/tests/test-awful-tag.lua +++ b/tests/test-awful-tag.lua @@ -64,7 +64,7 @@ local steps = { client.focus = client.get()[1] local c = client.focus - assert(c and client.focus == c) + assert(c and c.active) assert(beautiful.awesome_icon) local t = awful.tag.add("Test", {clients={c}, icon = beautiful.awesome_icon}) diff --git a/tests/test-current-desktop.lua b/tests/test-current-desktop.lua index c47a9847..bb6c6aa8 100644 --- a/tests/test-current-desktop.lua +++ b/tests/test-current-desktop.lua @@ -76,7 +76,7 @@ local steps = { -- Killing the client means the first selected tag counts function(count) if count == 1 then - assert(client.focus == c) + assert(c.active) c:kill() c = nil return diff --git a/tests/test-urgent.lua b/tests/test-urgent.lua index b36a4271..169c2512 100644 --- a/tests/test-urgent.lua +++ b/tests/test-urgent.lua @@ -56,7 +56,7 @@ local steps = { assert(#client.get() == 1) local c = client.get()[1] assert(not c.urgent, "Client is not urgent anymore.") - assert(c == client.focus, "Client is focused.") + assert(c.active, "Client is focused.") assert(awful.tag.getproperty(awful.screen.focused().tags[2], "urgent") == false) assert(awful.tag.getproperty(awful.screen.focused().tags[2], "urgent_count") == 0) return true