diff options
Diffstat (limited to 'libxcb/src')
-rw-r--r-- | libxcb/src/Makefile.am | 6 | ||||
-rw-r--r-- | libxcb/src/c_client.py | 4 | ||||
-rw-r--r-- | libxcb/src/xcb.h | 20 | ||||
-rw-r--r-- | libxcb/src/xcb_in.c | 12 |
4 files changed, 32 insertions, 10 deletions
diff --git a/libxcb/src/Makefile.am b/libxcb/src/Makefile.am index 346ee03cc..f2875dd18 100644 --- a/libxcb/src/Makefile.am +++ b/libxcb/src/Makefile.am @@ -139,7 +139,7 @@ endif EXTSOURCES += sync.c if BUILD_SYNC lib_LTLIBRARIES += libxcb-sync.la -libxcb_sync_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@ +libxcb_sync_la_LDFLAGS = -version-info 1:0:0 -no-undefined @lt_enable_auto_import@ libxcb_sync_la_LIBADD = $(XCB_LIBS) nodist_libxcb_sync_la_SOURCES = sync.c sync.h endif @@ -179,7 +179,7 @@ endif EXTSOURCES += xinput.c if BUILD_XINPUT lib_LTLIBRARIES += libxcb-xinput.la -libxcb_xinput_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@ +libxcb_xinput_la_LDFLAGS = -version-info 1:0:1 -no-undefined @lt_enable_auto_import@ libxcb_xinput_la_LIBADD = $(XCB_LIBS) nodist_libxcb_xinput_la_SOURCES = xinput.c xinput.h endif @@ -187,7 +187,7 @@ endif EXTSOURCES += xkb.c if BUILD_XKB lib_LTLIBRARIES += libxcb-xkb.la -libxcb_xkb_la_LDFLAGS = -version-info 0:0:0 -no-undefined +libxcb_xkb_la_LDFLAGS = -version-info 1:0:0 -no-undefined libxcb_xkb_la_LIBADD = $(XCB_LIBS) nodist_libxcb_xkb_la_SOURCES = xkb.c xkb.h endif diff --git a/libxcb/src/c_client.py b/libxcb/src/c_client.py index 72800045e..99fd307b0 100644 --- a/libxcb/src/c_client.py +++ b/libxcb/src/c_client.py @@ -1061,8 +1061,8 @@ def _c_serialize_helper(context, complex_type, if context in ('unserialize', 'unpack', 'sizeof') and not self.var_followed_by_fixed_fields: code_lines.append('%s xcb_block_len += sizeof(%s);' % (space, self.c_type)) code_lines.append('%s xcb_tmp += xcb_block_len;' % space) - # probably not needed - #_c_serialize_helper_insert_padding(context, code_lines, space, False) + code_lines.append('%s xcb_buffer_len += xcb_block_len;' % space) + code_lines.append('%s xcb_block_len = 0;' % space) count += _c_serialize_helper_fields(context, self, code_lines, temp_vars, diff --git a/libxcb/src/xcb.h b/libxcb/src/xcb.h index 63864dc37..e62c985d5 100644 --- a/libxcb/src/xcb.h +++ b/libxcb/src/xcb.h @@ -141,6 +141,26 @@ typedef struct { } xcb_generic_event_t; /** + * @brief GE event + * + * An event as sent by the XGE extension. The length field specifies the + * number of 4-byte blocks trailing the struct. + * + * @deprecated Since some fields in this struct have unfortunate names, it is + * recommended to use xcb_ge_generic_event_t instead. + */ +typedef struct { + uint8_t response_type; /**< Type of the response */ + uint8_t pad0; /**< Padding */ + uint16_t sequence; /**< Sequence number */ + uint32_t length; + uint16_t event_type; + uint16_t pad1; + uint32_t pad[5]; /**< Padding */ + uint32_t full_sequence; /**< full sequence */ +} xcb_ge_event_t; + +/** * @brief Generic error. * * A generic error structure. diff --git a/libxcb/src/xcb_in.c b/libxcb/src/xcb_in.c index fd6c2efd2..95087be4e 100644 --- a/libxcb/src/xcb_in.c +++ b/libxcb/src/xcb_in.c @@ -918,11 +918,13 @@ int _xcb_in_read(xcb_connection_t *c) #if HAVE_SENDMSG struct cmsghdr *hdr; - for (hdr = CMSG_FIRSTHDR(&msg); hdr; hdr = CMSG_NXTHDR(&msg, hdr)) { - if (hdr->cmsg_level == SOL_SOCKET && hdr->cmsg_type == SCM_RIGHTS) { - int nfd = (hdr->cmsg_len - CMSG_LEN(0)) / sizeof (int); - memcpy(&c->in.in_fd.fd[c->in.in_fd.nfd], CMSG_DATA(hdr), nfd * sizeof (int)); - c->in.in_fd.nfd += nfd; + if (msg.msg_controllen >= sizeof (struct cmsghdr)) { + for (hdr = CMSG_FIRSTHDR(&msg); hdr; hdr = CMSG_NXTHDR(&msg, hdr)) { + if (hdr->cmsg_level == SOL_SOCKET && hdr->cmsg_type == SCM_RIGHTS) { + int nfd = (hdr->cmsg_len - CMSG_LEN(0)) / sizeof (int); + memcpy(&c->in.in_fd.fd[c->in.in_fd.nfd], CMSG_DATA(hdr), nfd * sizeof (int)); + c->in.in_fd.nfd += nfd; + } } } #endif |