[Xcb] Setting a Virtual Root and xcb_change_property
Peter Harris
pharris at opentext.com
Mon Mar 17 08:02:32 PDT 2014
On 2014-03-17 10:23, Philip Rushik wrote:
> xcb_change_property(conn,XCB_PROP_MODE_REPLACE,win,atom,XCB_ATOM_WINDOW,0,sizeof(win),&win);
>
> This code compiles fine, but always gives me an error on execution (in
> xtrace) looking like this:
> 000:>:0018:Error 2=Value: major=18, minor=0, bad=0
Major 18 == ChangeProperty
bad=0.
> Now, I can't figure out what I am doing wrong, it seems totally legit to
> me. Anybody have any vroot insight?
The only 0 in your request is the "format" field.
Per
http://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html#requests:ChangeProperty
, "format" must be 8, 16, or 32.
In this case, since the atom type is WINDOW (an XID type, and XIDs are
always 32 bits), you should set that field to 32.
The next thing you're going to run into is a memory read overrun because
the number of 32-bit wide items you're sending is 1, not "sizeof(win)".
Peter Harris
--
Open Text Connectivity Solutions Group
Peter Harris http://connectivity.opentext.com/
Research and Development Phone: +1 905 762 6001
pharris at opentext.com Toll Free: 1 877 359 4866
More information about the Xcb
mailing list