How to observe changes in connected monitors via Xlib?
问题 I'm trying to write a program that would detect external monitors being plugged in and automatically enable and configure them through Xlib. I know that there is XRandr extension that allows this. My question is, how do I enable receiving XRandr events to my application? What event mask should I use? I know that xev app is able to do this. 回答1: Xev's source code: http://cgit.freedesktop.org/xorg/app/xev/tree/ Or: git clone git://anongit.freedesktop.org/xorg/app/xev 回答2: For the second part, I