0

I want to change/cover a client's content (in relation with a signal) : I just make a widget/wibox appear with the correct size and position.

So I put this in my manage signal :

local w = wibox({
        x = c.x,
        y = c.y,
        width = c.width,
        height = c.height,
        visible = false,
        ontop = true,
        widget = my_widget(c)
})
c.mawibox = w

As I unfocus the client, I toggle visibility : c.mawibox.visible = true but when I leave current tag, the wibox is still appearing : how to attach visibility only for the client's window?

Is there another way to produce this effect? is it possible to add a Cairo surface on top of the client's content?

david
  • 1,302
  • 1
  • 10
  • 21
  • "is it possible to add a Cairo surface on top of the client's content?": Well, what exactly are you trying to do? E.g.: Is this an ad blocker that just covers the advertisements in your browser? :-) However, I guess that the answer will be "no, there is no other way". – Uli Schlachter Feb 23 '20 at 07:21

1 Answers1

1

but when I leave current tag, the wibox is still appearing : how to attach visibility only for the client's window?

I would use tag.connect_signal("property::selected", function() [update your wibox here] end). You can check with c:isvisible() whether your client is, well, visible. If you also want to handle sticky clients (visible on all tags), you also need to handle the signal for "a client's sticky property changed".

Uli Schlachter
  • 9,337
  • 1
  • 23
  • 39