[Xcb] receiving XRRScreenChangeNotify in xpyb

chrysn chrysn at fsfe.org
Wed Dec 23 11:27:12 PST 2009


for arandr [1] (an xrandr gui written in python), i'd like to listen to
the XRRScreenChangeNotify event, which is supposed to notify of display
changes (eg, screen plugged in or resolution changed) [2].

i'm quite new to toolkit-less X programming, so i collected the various
bits and pieces i think i'll need for this task, but it doesn't work.
(the minimal non-working example is attached.)

my current approach is to get a connection with randr, call randr's
SelectInput(root, RRScreenChangeNotifyMask) and wait for any events.

(i've read [3] concerning XSelectInput in xcb, but came to the
conclusion that randr happens to have a method with nearly the same
name, so that does not apply.)

my testing system is debian sid with xserver 1.6.5, the intel 2.9.1
driver, kernel 2.6.31, xpyb 0.12, and libxcb 1.5; neither on my main X
server (when changing one of my two monitors' size using xrandr and when
un/replugging a monitor) nor on Xephyr (changing size using xrandr), any
events showed up on the attached demo program.

do you recognize a mistake that i made?


[1] http://christian.amsuess.com/tools/arandr/
[2] http://www.xfree86.org/current/Xrandr.3.html
[3] http://lists.freedesktop.org/archives/xcb/2005-February/000331.html

To use raw power is to make yourself infinitely vulnerable to greater powers.
  -- Bene Gesserit axiom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eventdemo.py
Type: text/x-python
Size: 512 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/xcb/attachments/20091223/fb2ed9ad/attachment.py 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20091223/fb2ed9ad/attachment.pgp 

More information about the Xcb mailing list