buffet / kiwmi

A fully programmable Wayland Compositor
Mozilla Public License 2.0
612 stars 22 forks source link

View IDs #28

Closed ghost closed 3 years ago

ghost commented 4 years ago

I need a simple way to identify views in my config. Can you please add something like view IDs?

I've tried to do this 'little change' myself, but can't seem to get it right.

Edit: It seems I just had an awful error in my init.lua, otherwise it could (or could not) have worked.

buffet commented 4 years ago

View IDs are something I tried to avoid. You should be able to just store references to them, and directly compare them (with ==). What's your exact usecase?

ghost commented 4 years ago

Why do you not want them to have IDs?

buffet commented 4 years ago

ID systems are just awkward when you already have refs.

You mean as keys in a table? That might be an issue, I'll check what we could do.

One way should be to guarantee that all views always get the same ref.

ghost commented 3 years ago

Just realised I can kind-of do this simply by keeping a table of all views & searching through it every time. I haven't yet adapted my config to it, but I think it'll work.

I'll let you know then, & I think if everything's OK this can be closed afterwards.

ghost commented 3 years ago

Tested now, seems to work pretty well.

Anyway, having it 'native' is still welcome at any time.