How to monitor active window changes using xcb?

330 Views Asked by At

I'm trying to find a way to monitor when the _NET_ACTIVE_WINDOW property changes. Right now I'm polling every 1 second to update the current active window. I know that there's a way to get events about this, I've seen references to it, but I can't seem to find any code (that I can understand) that explains how to do it.

1

There are 1 best solutions below

2
On BEST ANSWER

If you set PropertyChange mask on root window you'll start getting PropertyNotify events to your code. See example in my answer here: Linux get notification on focused gui window change