2015-07-10 13:17:50 +02:00
|
|
|
--- Tests for focus signals / property.
|
|
|
|
-- Test for https://github.com/awesomeWM/awesome/issues/134.
|
|
|
|
|
|
|
|
awful = require("awful")
|
|
|
|
timer = require("gears.timer")
|
|
|
|
|
|
|
|
beautiful = require("beautiful")
|
|
|
|
beautiful.border_normal = "#0000ff"
|
|
|
|
beautiful.border_focus = "#00ff00"
|
|
|
|
|
|
|
|
client.connect_signal("focus", function(c)
|
|
|
|
c.border_color = "#ff0000"
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
local steps = {
|
|
|
|
-- border_color should get applied via focus signal for first client on tag.
|
|
|
|
function(count)
|
|
|
|
if count == 1 then
|
2015-09-30 00:05:56 +02:00
|
|
|
awful.spawn("xterm")
|
2015-07-10 13:17:50 +02:00
|
|
|
else
|
|
|
|
local c = client.get()[1]
|
|
|
|
if c then
|
|
|
|
assert(c.border_color == "#ff0000")
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
|
|
|
|
-- border_color should get applied via focus signal for second client on tag.
|
|
|
|
function(count)
|
|
|
|
if count == 1 then
|
2015-09-30 00:05:56 +02:00
|
|
|
awful.spawn("xterm")
|
2015-07-10 13:17:50 +02:00
|
|
|
else
|
|
|
|
if #client.get() == 2 then
|
|
|
|
local c = client.get()[1]
|
|
|
|
assert(c == client.focus)
|
|
|
|
if c then
|
|
|
|
assert(c.border_color == "#ff0000")
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
|
|
|
require("_runner").run_steps(steps)
|