From aae4bce3eb5e721f8dea776586d77e8ae91a438f3a7b440d93e9eafcb5558827 Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Mon, 8 Jan 2018 14:50:51 +0000 Subject: [PATCH] Accepting request 562552 from home:michalsrb:branches:X11:XOrg - Enable xinput extension. (bnc#1074249) - U_add-support-for-eventstruct.patch * Update xinput to the state when it was enabled by default upstream. - Update xinput to the state when it was enabled by default upstream. (bnc#1074249) * U_SendExtensionEvent-uses-eventstruct.patch * U_add-support-for-eventstruct.patch * U_xinput-typedef-for-event_type_base.patch OBS-URL: https://build.opensuse.org/request/show/562552 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/libxcb?expand=0&rev=48 --- U_add-support-for-eventstruct.patch | 104 ++++++++++++++++++++++++++++ baselibs.conf | 2 + libxcb.changes | 8 +++ libxcb.spec | 24 +++++++ 4 files changed, 138 insertions(+) create mode 100644 U_add-support-for-eventstruct.patch diff --git a/U_add-support-for-eventstruct.patch b/U_add-support-for-eventstruct.patch new file mode 100644 index 0000000..66b5783 --- /dev/null +++ b/U_add-support-for-eventstruct.patch @@ -0,0 +1,104 @@ +From ee9dfc9a7658e7fe75d27483bb5ed1ba4d1e2c86 Mon Sep 17 00:00:00 2001 +From: Christian Linhart +Date: Wed, 25 Jan 2017 10:21:05 +0100 +Subject: [PATCH] add support for eventstruct + +eventstruct allows to use events as part of requests. +This is, e.g., needed by xcb_input_send_extension_event. + +Signed-off-by: Christian Linhart +--- + src/c_client.py | 32 +++++++++++++++++++++++++++++++- + src/xcb.h | 12 ++++++++++++ + 2 files changed, 43 insertions(+), 1 deletion(-) + +diff --git a/src/c_client.py b/src/c_client.py +index b0eb47c..0cbdf30 100644 +--- a/src/c_client.py ++++ b/src/c_client.py +@@ -437,7 +437,11 @@ def _c_type_setup(self, name, postfix): + first_field_after_varsized = None + + for field in self.fields: +- field.c_field_type = _t(field.field_type) ++ if field.type.is_event: ++ field.c_field_type = _t(field.field_type + ('event',)) ++ else: ++ field.c_field_type = _t(field.field_type) ++ + field.c_field_const_type = ('' if field.type.nmemb == 1 else 'const ') + field.c_field_type + field.c_field_name = _cpp(field.field_name) + field.c_subscript = '[%d]' % field.type.nmemb if (field.type.nmemb and field.type.nmemb > 1) else '' +@@ -3156,6 +3160,28 @@ def c_request(self, name): + # TODO: what about aux helpers? + _man_request(self, name, void=not self.reply, aux=False) + ++ ++def c_eventstruct(self, name): ++ #add fields that are needed to get the event-type in a generic way ++ self.fields.append( Field( tevent, tevent.name, 'event_header', False, True, True) ) ++ ++ if self.contains_ge_events: ++ #TODO: add header of ge-events as an extra field ++ raise Exception( 'eventstructs with ge-events are not yet supported' ) ++ ++ _c_type_setup(self, name, ()) ++ ++ #correct the format of the field names ++ for field in self.fields: ++ field.c_field_name = _n_item(field.c_field_name).lower() ++ ++ _c_complex(self) ++ _c_iterator(self, name) ++ ++ if not self.fixed_size(): ++ #TODO: Create sizeof function (and maybe other accessors) for var-sized eventstructs ++ raise Exception( 'var sized eventstructs are not yet supported' ) ++ + def c_event(self, name): + ''' + Exported function that handles event declarations. +@@ -3253,6 +3279,7 @@ output = {'open' : c_open, + 'struct' : c_struct, + 'union' : c_union, + 'request' : c_request, ++ 'eventstruct' : c_eventstruct, + 'event' : c_event, + 'error' : c_error, + } +@@ -3296,6 +3323,9 @@ Refer to the README file in xcb/proto for more info. + ''') + raise + ++# predefined datatype globals. ++tevent = SimpleType(('xcb_raw_generic_event_t',), 32) ++ + # Ensure the man subdirectory exists + try: + os.mkdir('man') +diff --git a/src/xcb.h b/src/xcb.h +index 6873e79..cbc0f2b 100644 +--- a/src/xcb.h ++++ b/src/xcb.h +@@ -143,6 +143,18 @@ typedef struct { + } xcb_generic_event_t; + + /** ++ * @brief Raw Generic event. ++ * ++ * A generic event structure as used on the wire, i.e., without the full_sequence field ++ */ ++typedef struct { ++ uint8_t response_type; /**< Type of the response */ ++ uint8_t pad0; /**< Padding */ ++ uint16_t sequence; /**< Sequence number */ ++ uint32_t pad[7]; /**< Padding */ ++} xcb_raw_generic_event_t; ++ ++/** + * @brief GE event + * + * An event as sent by the XGE extension. The length field specifies the +-- +2.13.6 + diff --git a/baselibs.conf b/baselibs.conf index a291e1c..404473d 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -20,6 +20,7 @@ libxcb-xf86dri0 libxcb-xfixes0 libxcb-xkb1 libxcb-xinerama0 +libxcb-xinput0 libxcb-xtest0 libxcb-xv0 libxcb-xvmc0 @@ -45,6 +46,7 @@ libxcb-devel requires "libxcb-xfixes0- = " requires "libxcb-xkb1- = " requires "libxcb-xinerama0- = " + requires "libxcb-xinput0- = " requires "libxcb-xtest0- = " requires "libxcb-xv0- = " requires "libxcb-xvmc0- = " diff --git a/libxcb.changes b/libxcb.changes index 249d310..a27a4c6 100644 --- a/libxcb.changes +++ b/libxcb.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Jan 8 13:53:53 UTC 2018 - msrb@suse.com + +- Enable xinput extension. (bnc#1074249) +- U_add-support-for-eventstruct.patch + * Update xinput to the state when it was enabled by default + upstream. + ------------------------------------------------------------------- Fri Jan 5 10:44:07 UTC 2018 - msrb@suse.com diff --git a/libxcb.spec b/libxcb.spec index e298fb0..a7894df 100644 --- a/libxcb.spec +++ b/libxcb.spec @@ -38,6 +38,7 @@ Source: %{name}-%{version}.tar.bz2 Source1: baselibs.conf Patch1: bug-262309_xcb-xauthlocalhostname.diff Patch2: n_If-auth-with-credentials-for-hostname-fails-retry-with-XAUTHLOCALHOSTNAME.patch +Patch3: U_add-support-for-eventstruct.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf >= 2.57 BuildRequires: automake @@ -288,6 +289,18 @@ Xinerama is an extension to the X Window System which enables multi-headed X applications and window managers to use two or more physical displays as one large virtual display. +%package -n libxcb-xinput0 +Summary: X11 XInput Extension C library +Group: System/Libraries + +%description -n libxcb-xinput0 +The X protocol C-language Binding (XCB) is a replacement for Xlib +featuring a small footprint, latency hiding, direct access to the +protocol, improved threading support, and extensibility. + +Xinput is an extension to the X Window System intended to replace +core input processing. + %package -n libxcb-xtest0 Summary: X11 XTEST Extension C library Group: System/Libraries @@ -351,6 +364,7 @@ Requires: libxcb-sync1 = %version Requires: libxcb-xf86dri0 = %version Requires: libxcb-xfixes0 = %version Requires: libxcb-xinerama0 = %version +Requires: libxcb-xinput0 = %version Requires: libxcb-xkb1 = %version Requires: libxcb-xtest0 = %version Requires: libxcb-xv0 = %version @@ -384,11 +398,13 @@ libxcb. %setup -q %patch -P 1 -p0 %patch2 -p1 +%patch3 -p1 %build ./autogen.sh %configure --docdir=%_docdir/%name \ --disable-static \ + --enable-xinput \ --enable-xkb \ --enable-sendfds make %{?_smp_mflags} @@ -477,6 +493,10 @@ rm -f "%buildroot/%_libdir"/*.la %postun -n libxcb-xinerama0 -p /sbin/ldconfig +%post -n libxcb-xinput0 -p /sbin/ldconfig + +%postun -n libxcb-xinput0 -p /sbin/ldconfig + %post -n libxcb-xtest0 -p /sbin/ldconfig %postun -n libxcb-xtest0 -p /sbin/ldconfig @@ -568,6 +588,10 @@ rm -f "%buildroot/%_libdir"/*.la %defattr(-,root,root) %_libdir/libxcb-xinerama.so.0* +%files -n libxcb-xinput0 +%defattr(-,root,root) +%_libdir/libxcb-xinput.so.0* + %files -n libxcb-xtest0 %defattr(-,root,root) %_libdir/libxcb-xtest.so.0*