client: Update existing code to use `c.active`.
This commit is contained in:
parent
58f3ea740f
commit
ba5385dd40
|
@ -536,7 +536,7 @@ function client.object.move_to_screen(self, s)
|
||||||
end
|
end
|
||||||
s = get_screen(s)
|
s = get_screen(s)
|
||||||
if get_screen(self.screen) ~= s then
|
if get_screen(self.screen) ~= s then
|
||||||
local sel_is_focused = self == capi.client.focus
|
local sel_is_focused = self.active
|
||||||
self.screen = s
|
self.screen = s
|
||||||
screen.focus(s)
|
screen.focus(s)
|
||||||
|
|
||||||
|
|
|
@ -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
|
-- Get a color for a titlebar, this tests many values from the array and the theme
|
||||||
local function get_color(name, c, args)
|
local function get_color(name, c, args)
|
||||||
local suffix = "_normal"
|
local suffix = "_normal"
|
||||||
if capi.client.focus == c then
|
if c.active then
|
||||||
suffix = "_focus"
|
suffix = "_focus"
|
||||||
end
|
end
|
||||||
local function get(array)
|
local function get(array)
|
||||||
|
@ -707,7 +707,7 @@ function titlebar.widget.button(c, name, selector, action)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local prefix = "normal"
|
local prefix = "normal"
|
||||||
if capi.client.focus == c then
|
if c.active then
|
||||||
prefix = "focus"
|
prefix = "focus"
|
||||||
end
|
end
|
||||||
if img ~= "" then
|
if img ~= "" then
|
||||||
|
|
|
@ -352,7 +352,7 @@ local function tasklist_label(c, args, tb)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local focused = capi.client.focus == c
|
local focused = c.active
|
||||||
-- Handle transient_for: the first parent that does not skip the taskbar
|
-- Handle transient_for: the first parent that does not skip the taskbar
|
||||||
-- is considered to be focused, if the real client has skip_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
|
if not focused and capi.client.focus and capi.client.focus.skip_taskbar
|
||||||
|
@ -723,7 +723,7 @@ end
|
||||||
-- @filterfunction awful.tasklist.filter.focused
|
-- @filterfunction awful.tasklist.filter.focused
|
||||||
function tasklist.filter.focused(c, screen)
|
function tasklist.filter.focused(c, screen)
|
||||||
-- Only print client on the same screen as this widget
|
-- 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
|
end
|
||||||
|
|
||||||
--- Get all the clients in an undefined order.
|
--- Get all the clients in an undefined order.
|
||||||
|
|
|
@ -133,7 +133,7 @@ table.insert(steps, function()
|
||||||
c1, c2 = client.get()[1], client.get()[2]
|
c1, c2 = client.get()[1], client.get()[2]
|
||||||
|
|
||||||
-- This should still be the case
|
-- This should still be the case
|
||||||
assert(client.focus == c1)
|
assert(c1.active)
|
||||||
|
|
||||||
c2:emit_signal("request::activate", "i_said_so")
|
c2:emit_signal("request::activate", "i_said_so")
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ end)
|
||||||
-- Check if writing a focus stealing filter works.
|
-- Check if writing a focus stealing filter works.
|
||||||
table.insert(steps, function()
|
table.insert(steps, function()
|
||||||
-- This should still be the case
|
-- This should still be the case
|
||||||
assert(client.focus == c2)
|
assert(c2.active)
|
||||||
|
|
||||||
original_count = #awful.ewmh.generic_activate_filters
|
original_count = #awful.ewmh.generic_activate_filters
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ end)
|
||||||
|
|
||||||
table.insert(steps, function()
|
table.insert(steps, function()
|
||||||
-- The request should have been denied
|
-- The request should have been denied
|
||||||
assert(client.focus == c2)
|
assert(c2.active)
|
||||||
|
|
||||||
-- Test the remove function
|
-- Test the remove function
|
||||||
awful.ewmh.remove_activate_filter(function() end)
|
awful.ewmh.remove_activate_filter(function() end)
|
||||||
|
@ -171,7 +171,7 @@ table.insert(steps, function()
|
||||||
|
|
||||||
c1:emit_signal("request::activate", "i_said_so")
|
c1:emit_signal("request::activate", "i_said_so")
|
||||||
|
|
||||||
return client.focus == c1
|
return c1.active
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local has_error
|
local has_error
|
||||||
|
|
|
@ -64,7 +64,7 @@ local steps = {
|
||||||
|
|
||||||
client.focus = client.get()[1]
|
client.focus = client.get()[1]
|
||||||
local c = client.focus
|
local c = client.focus
|
||||||
assert(c and client.focus == c)
|
assert(c and c.active)
|
||||||
assert(beautiful.awesome_icon)
|
assert(beautiful.awesome_icon)
|
||||||
|
|
||||||
local t = awful.tag.add("Test", {clients={c}, icon = beautiful.awesome_icon})
|
local t = awful.tag.add("Test", {clients={c}, icon = beautiful.awesome_icon})
|
||||||
|
|
|
@ -76,7 +76,7 @@ local steps = {
|
||||||
-- Killing the client means the first selected tag counts
|
-- Killing the client means the first selected tag counts
|
||||||
function(count)
|
function(count)
|
||||||
if count == 1 then
|
if count == 1 then
|
||||||
assert(client.focus == c)
|
assert(c.active)
|
||||||
c:kill()
|
c:kill()
|
||||||
c = nil
|
c = nil
|
||||||
return
|
return
|
||||||
|
|
|
@ -56,7 +56,7 @@ local steps = {
|
||||||
assert(#client.get() == 1)
|
assert(#client.get() == 1)
|
||||||
local c = client.get()[1]
|
local c = client.get()[1]
|
||||||
assert(not c.urgent, "Client is not urgent anymore.")
|
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") == false)
|
||||||
assert(awful.tag.getproperty(awful.screen.focused().tags[2], "urgent_count") == 0)
|
assert(awful.tag.getproperty(awful.screen.focused().tags[2], "urgent_count") == 0)
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in New Issue