[Xcb] xcb-screensaver notify_event_t structure

Daniel Martin consume.noise at gmail.com
Thu Jul 17 09:04:05 PDT 2014


On 17 July 2014 17:49, Philip Rushik <prushik at gmail.com> wrote:
> Hi everybody,
> So I posted awhile ago about XCB and the screensaver extension. I got
> that all working on my machine, but now I want to use the same code on
> another machine and it's not working...... here's the details:
>
> In my code, I do this:
> xcb_screensaver_notify_event_t *e =
> (xcb_screensaver_notify_event_t*)xcb_wait_for_event(conn);
>
>
> if ((e->response_type)==xss_event_base+XCB_SCREENSAVER_NOTIFY)
>      if ((uint8_t)e->code==XCB_SCREENSAVER_STATE_OFF)
>
>
> Which looks like it should be totally fine, and worked fine on my
> development machine with xcb-1.8.1 I think. The new machine I am
> trying to compile the code on has xcb-1.10, the newest version.
> Compilation fails saying that xcb_screensaver_notify_event_t has no
> member named "code". I checked out xcb/screensaver.h where it's
> defined, and sure enough, there is no member called "code", but in
> 1.8.1 there was.
> http://www.x.org/releases/current/doc/man/man3/xcb_screensaver_notify_event_t.3.xhtml
> says there should be a code member also, but xcb documentation isn't
> exactly known for it's correctness.
>
> So, what happened to the code member? is there some other way that I
> don't know about to differentiate between cycle and
> activate/deactivate events? Why has the "code" member of
> screensaver_notify_event_t been removed? How can I fix this?

The 'code' member existed due to a bug in the protocol description,
which was fixed:
     http://cgit.freedesktop.org/xcb/proto/commit/src/screensaver.xml?id=a50670c

Now, the 'state' member holds the data you're looking for.


More information about the Xcb mailing list