[Xcb] xcb-xfixes, problem with selection change event.

Uli Schlachter psychon at znc.in
Thu Dec 26 06:39:15 PST 2013


On 26.12.2013 11:47, xiangxw5689 wrote:
> I'm looking for help with selection change event in xcb-xfixes.
> I want capture selection change event and I write a simple program with xcb-xfixes. But it does not work.
> Please help, thanks.

After reading the above, my first idea is the following:


("It does not work!" is one of the worst kinds of reports possible.)

My next idea was "this mailing list is the wrong place to ask", but whatever....

>     // delivers request
>     xcb_xfixes_select_selection_input_checked(c, win, XCB_ATOM_PRIMARY, mask);
>     xcb_xfixes_select_selection_input_checked(c, win, XCB_ATOM_SECONDARY, mask);
>     // recevie events
>     uint response_type;
>     while (e = xcb_wait_for_event(c)) {

Your SelectSelectionInput requests are never sent to the server. You have to
call xcb_flush() somewhere here.

Also, remove the "_checked" from those two function names. For these functions,
you should capture their return value and eventually call xcb_request_check()
with the cookie. Since you doin't do this and since I don't think you actually
want this, just call the unchecked version.

"In the beginning the Universe was created. This has made a lot of
 people very angry and has been widely regarded as a bad move."

More information about the Xcb mailing list