catch event when xprop "change"

Glynn Clements glynn at
Wed Nov 15 15:27:38 PST 2006

Akbar wrote:

> Hi,
> I don't know if this the right mailing list to ask, so:
> this is the command:
> xprop -root _NET_CURRENT_DESKTOP
> or you can replace with
> xprop -root blablabla
> I need to find a way to catch the event when return value of these
> commands change (c api).

	XSelectInput(dpy, DefaultRootWindow(dpy), PropertyChangeMask);

You will then receive PropertyNotify events when the root window's
properties change.

If you are using a GUI toolkit, it would be safer to open a new X
connection for this purpose, to ensure that the toolkit doesn't
interfere with your code's event processing.

Glynn Clements <glynn at>

More information about the xorg mailing list