From d3a0dcffcdb547cb7f8b205505e892a21320ebbb Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Thu, 18 Jul 2019 00:18:36 -0400 Subject: [PATCH] tests: Add client:kill() to the shims. --- tests/examples/shims/client.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/examples/shims/client.lua b/tests/examples/shims/client.lua index bf76a426..00bdfa98 100644 --- a/tests/examples/shims/client.lua +++ b/tests/examples/shims/client.lua @@ -101,6 +101,27 @@ function client.gen_fake(args) --TODO end + function ret:kill() + local old_tags = ret:tags() or {} + + for k, c in ipairs(clients) do + if c == ret then + ret:emit_signal("unmanaged", c) + ret.valid = false + table.remove(clients, k) + break + end + end + + ret._tags = {} + + for _, t in ipairs(old_tags) do + ret:emit_signal("untagged", t) + t:emit_signal("property::tags") + end + + assert(not ret.valid) + end titlebar_meta(ret) function ret:tags(new) --FIXME