diff --git a/third_party/xcbproto/README.chromium b/third_party/xcbproto/README.chromium index 0f97b777c6fcac..8993074ba3b8f9 100644 --- a/third_party/xcbproto/README.chromium +++ b/third_party/xcbproto/README.chromium @@ -1,7 +1,7 @@ Name: xcbproto Short Name: xcbproto URL: https://gitlab.freedesktop.org/xorg/proto/xcbproto -Version: 496e3ce329c3cc9b32af4054c30fa0f306deb007 +Version: 70ca65fa35c3760661b090bc4b2601daa7a099b8 CPEPrefix: unknown Security Critical: no License: MIT diff --git a/third_party/xcbproto/VERSION b/third_party/xcbproto/VERSION index b64ae9b02d1935..626f0e2a4c2632 100644 --- a/third_party/xcbproto/VERSION +++ b/third_party/xcbproto/VERSION @@ -1 +1 @@ -496e3ce329c3cc9b32af4054c30fa0f306deb007 +70ca65fa35c3760661b090bc4b2601daa7a099b8 diff --git a/third_party/xcbproto/patch.diff b/third_party/xcbproto/patch.diff index 2800338e07a803..1d72d6fb8deb03 100644 --- a/third_party/xcbproto/patch.diff +++ b/third_party/xcbproto/patch.diff @@ -1,6 +1,6 @@ diff -ru xcbproto/src/glx.xml src/src/glx.xml ---- xcbproto/src/glx.xml 2021-02-10 12:51:13.785903766 -0800 -+++ src/src/glx.xml 2021-02-04 15:13:24.836890047 -0800 +--- xcbproto/src/glx.xml 2022-03-25 16:30:06.066425385 -0700 ++++ src/src/glx.xml 2022-03-25 16:29:28.146096207 -0700 @@ -62,8 +62,6 @@ glx:WINDOW @@ -292,8 +292,8 @@ diff -ru xcbproto/src/glx.xml src/src/glx.xml diff -ru xcbproto/src/present.xml src/src/present.xml ---- xcbproto/src/present.xml 2021-02-10 12:51:13.785903766 -0800 -+++ src/src/present.xml 2021-02-10 12:51:07.933863954 -0800 +--- xcbproto/src/present.xml 2022-03-25 16:30:06.050425246 -0700 ++++ src/src/present.xml 2022-03-25 16:27:47.661223477 -0700 @@ -89,7 +89,7 @@ @@ -304,8 +304,8 @@ diff -ru xcbproto/src/present.xml src/src/present.xml diff -ru xcbproto/src/randr.xml src/src/randr.xml ---- xcbproto/src/randr.xml 2021-02-10 12:51:13.785903766 -0800 -+++ src/src/randr.xml 2021-02-04 11:51:16.530051106 -0800 +--- xcbproto/src/randr.xml 2022-03-25 16:30:06.050425246 -0700 ++++ src/src/randr.xml 2022-03-25 16:27:47.661223477 -0700 @@ -803,64 +803,6 @@ 6 @@ -479,8 +479,8 @@ diff -ru xcbproto/src/randr.xml src/src/randr.xml diff -ru xcbproto/src/shm.xml src/src/shm.xml ---- xcbproto/src/shm.xml 2021-02-10 12:51:13.789903793 -0800 -+++ src/src/shm.xml 2021-02-04 11:51:16.530051106 -0800 +--- xcbproto/src/shm.xml 2022-03-25 16:30:06.050425246 -0700 ++++ src/src/shm.xml 2022-03-25 16:27:47.661223477 -0700 @@ -78,7 +78,7 @@ @@ -491,8 +491,8 @@ diff -ru xcbproto/src/shm.xml src/src/shm.xml diff -ru xcbproto/src/xinput.xml src/src/xinput.xml ---- xcbproto/src/xinput.xml 2021-02-10 12:51:13.789903793 -0800 -+++ src/src/xinput.xml 2021-02-08 17:31:46.995137506 -0800 +--- xcbproto/src/xinput.xml 2022-03-25 16:30:06.066425385 -0700 ++++ src/src/xinput.xml 2022-03-25 16:29:28.146096207 -0700 @@ -200,7 +200,12 @@ devices_len @@ -693,8 +693,8 @@ diff -ru xcbproto/src/xinput.xml src/src/xinput.xml diff -ru xcbproto/src/xproto.xml src/src/xproto.xml ---- xcbproto/src/xproto.xml 2021-02-10 12:51:13.789903793 -0800 -+++ src/src/xproto.xml 2021-02-04 15:13:24.840890072 -0800 +--- xcbproto/src/xproto.xml 2022-03-25 16:30:06.070425420 -0700 ++++ src/src/xproto.xml 2022-03-25 16:29:28.150096242 -0700 @@ -963,6 +963,7 @@ 66 67 @@ -737,15 +737,10 @@ diff -ru xcbproto/src/xproto.xml src/src/xproto.xml -Only in src/xcbgen: align.pyc -Only in src/xcbgen: error.pyc -Only in src/xcbgen: expr.pyc -Only in src/xcbgen: __init__.pyc -Only in src/xcbgen: matcher.pyc -Only in src/xcbgen: state.pyc +Only in src/xcbgen: __pycache__ diff -ru xcbproto/xcbgen/xtypes.py src/xcbgen/xtypes.py ---- xcbproto/xcbgen/xtypes.py 2021-02-10 12:51:13.789903793 -0800 -+++ src/xcbgen/xtypes.py 2021-02-04 15:13:24.840890072 -0800 +--- xcbproto/xcbgen/xtypes.py 2022-03-25 16:30:06.070425420 -0700 ++++ src/xcbgen/xtypes.py 2022-03-25 16:29:28.150096242 -0700 @@ -226,7 +226,7 @@ Derived class which represents a file descriptor. ''' @@ -755,4 +750,3 @@ diff -ru xcbproto/xcbgen/xtypes.py src/xcbgen/xtypes.py self.is_fd = True def fixed_size(self): -Only in src/xcbgen: xtypes.pyc diff --git a/third_party/xcbproto/src/doc/xml-xcb.txt b/third_party/xcbproto/src/doc/xml-xcb.txt index f5b9aed13ad7bd..baef734168015e 100644 --- a/third_party/xcbproto/src/doc/xml-xcb.txt +++ b/third_party/xcbproto/src/doc/xml-xcb.txt @@ -65,8 +65,8 @@ Top-Level Elements This element represents a data structure. The name attribute gives the name of the structure. The content represents the fields of the structure, and - consists of one or more of the field, pad, and list elements described in - the section "Structure Contents" below. + consists of one or more of the length, field, pad, and list elements described + in the section "Structure Contents" below. structure contents @@ -215,6 +215,23 @@ enum; the value is restricted to one of the constants named in the enum. declares the data type of the field, and the name attribute gives the name of the field. +expression + This element overrides the length of the data structure by specifying it + explicitly instead of it being defined by the layout of the structure. + This makes it possible to handle structures with conditional fields + (see the element) where the future revisions of protocols may + introduce new variants and old code must still properly ignore them. + + The content is an expression giving the length of the data structure in terms + of other fields in the structure. See the section "Expressions" for details + on the expression representation. + + The expression must not depend on conditional fields. + + Additionally, the length of the data structure must be at least such that it + includes the fields that the expression depends on. Smaller length is + considered a violation of the protocol. + This element represents a file descriptor field passed with the request. The diff --git a/third_party/xcbproto/src/src/glx.xml b/third_party/xcbproto/src/src/glx.xml index 70aa9f9fe0a9aa..6e728e2f01716b 100644 --- a/third_party/xcbproto/src/src/glx.xml +++ b/third_party/xcbproto/src/src/glx.xml @@ -489,6 +489,7 @@ The patch that fixed this server bug in X.org CVS is here: gl_str_len + glx_str_len @@ -525,6 +526,7 @@ The patch that fixed this server bug in X.org CVS is here: gl_str_len + glx_str_len diff --git a/third_party/xcbproto/src/src/xcb.xsd b/third_party/xcbproto/src/src/xcb.xsd index dc3d7cc181c75b..86a51c53665fb7 100644 --- a/third_party/xcbproto/src/src/xcb.xsd +++ b/third_party/xcbproto/src/src/xcb.xsd @@ -101,6 +101,13 @@ authorization from the authors. + + + + + + + @@ -210,6 +217,7 @@ authorization from the authors. + diff --git a/third_party/xcbproto/src/src/xfixes.xml b/third_party/xcbproto/src/src/xfixes.xml index 0a3d5ffeed4817..a01cd7b0c3de80 100644 --- a/third_party/xcbproto/src/src/xfixes.xml +++ b/third_party/xcbproto/src/src/xfixes.xml @@ -26,7 +26,7 @@ authorization from the authors. --> + major-version="6" minor-version="0"> xproto render shape @@ -359,4 +359,24 @@ authorization from the authors. + + + + + 0 + 0 + + + + + + + + + + + + + + diff --git a/third_party/xcbproto/src/src/xinput.xml b/third_party/xcbproto/src/src/xinput.xml index 33a93d2fe2d493..90db8f939f8d05 100644 --- a/third_party/xcbproto/src/src/xinput.xml +++ b/third_party/xcbproto/src/src/xinput.xml @@ -33,7 +33,7 @@ authorization from the authors. --> + major-version="2" minor-version="4"> xfixes xproto @@ -1607,6 +1607,7 @@ authorization from the authors. 2 3 8 + 9 @@ -1680,6 +1681,14 @@ authorization from the authors. + + + + + + + + @@ -1695,6 +1704,12 @@ authorization from the authors. + + + len + 4 + + @@ -1752,6 +1767,11 @@ authorization from the authors. + + Gesture + + + @@ -1872,11 +1892,13 @@ authorization from the authors. - 0 - 1 - 2 - 3 - 4 + 0 + 1 + 2 + 3 + 4 + 5 + 6 @@ -2485,6 +2507,72 @@ authorization from the authors. + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/third_party/xcbproto/src/src/xprint.xml b/third_party/xcbproto/src/src/xprint.xml index f9af65fa6046c9..fa3bb7ff1ff755 100644 --- a/third_party/xcbproto/src/src/xprint.xml +++ b/third_party/xcbproto/src/src/xprint.xml @@ -102,7 +102,7 @@ authorization from the authors. printerNameLen - + localeLen @@ -125,7 +125,7 @@ authorization from the authors. printerNameLen - + localeLen @@ -177,11 +177,11 @@ authorization from the authors. len_data - + len_fmt - + len_options diff --git a/third_party/xcbproto/src/src/xproto.xml b/third_party/xcbproto/src/src/xproto.xml index 928a1c39c8c28a..21f332f18d52c4 100644 --- a/third_party/xcbproto/src/src/xproto.xml +++ b/third_party/xcbproto/src/src/xproto.xml @@ -2982,25 +2982,21 @@ results (no grabs are established) if there is a conflicting grab for any combin ]]> - @@ -3011,7 +3007,8 @@ Another client has already issued a GrabKey with the same button/key combination on the same window. ]]> = (3, 3): + from xml.etree.ElementTree import SubElement +else: + from xml.etree.cElementTree import SubElement + import __main__ verbose_align_log = False @@ -503,6 +510,8 @@ class ComplexType(Type): Public fields added: fields is an array of Field objects describing the structure fields. + length_expr is an expression that defines the length of the structure. + ''' def __init__(self, name, elt): Type.__init__(self, name) @@ -512,6 +521,7 @@ def __init__(self, name, elt): self.nmemb = 1 self.size = 0 self.lenfield_parent = [self] + self.length_expr = None # get required_start_alignment required_start_align_element = elt.find("required_start_align") @@ -573,6 +583,9 @@ def resolve(self, module): type = module.get_type('INT32') type.make_fd_of(module, self, fd_name) continue + elif child.tag == 'length': + self.length_expr = Expression(list(child)[0], self) + continue else: # Hit this on Reply continue @@ -1346,6 +1359,15 @@ def __init__(self, name, elt): if self.required_start_align is None: self.required_start_align = Alignment(4,0) + # All errors are basically the same, but they still got different XML + # for historic reasons. This 'invents' the missing parts. + if len(self.elt) < 1: + SubElement(self.elt, "field", type="CARD32", name="bad_value") + if len(self.elt) < 2: + SubElement(self.elt, "field", type="CARD16", name="minor_opcode") + if len(self.elt) < 3: + SubElement(self.elt, "field", type="CARD8", name="major_opcode") + def add_opcode(self, opcode, name, main): self.opcodes[name] = opcode if main: diff --git a/ui/gfx/x/generated_protos/damage.cc b/ui/gfx/x/generated_protos/damage.cc index 81b27484005654..95044930a2d26e 100644 --- a/ui/gfx/x/generated_protos/damage.cc +++ b/ui/gfx/x/generated_protos/damage.cc @@ -56,7 +56,10 @@ Damage::Damage(Connection* connection, const x11::QueryExtensionReply& info) std::string Damage::BadDamageError::ToString() const { std::stringstream ss_; ss_ << "Damage::BadDamageError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -67,6 +70,9 @@ void ReadError(Damage::BadDamageError* error_, auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -79,6 +85,15 @@ void ReadError(Damage::BadDamageError* error_, // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } template <> diff --git a/ui/gfx/x/generated_protos/damage.h b/ui/gfx/x/generated_protos/damage.h index 581e8a6f5e33ed..ceada070848bc1 100644 --- a/ui/gfx/x/generated_protos/damage.h +++ b/ui/gfx/x/generated_protos/damage.h @@ -92,6 +92,9 @@ class COMPONENT_EXPORT(X11) Damage { struct BadDamageError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; diff --git a/ui/gfx/x/generated_protos/glx.cc b/ui/gfx/x/generated_protos/glx.cc index f0adfb92465adc..dfb2fb31de6699 100644 --- a/ui/gfx/x/generated_protos/glx.cc +++ b/ui/gfx/x/generated_protos/glx.cc @@ -2797,6 +2797,9 @@ Future Glx::SetClientInfoARB( buf.Write(&gl_extension_string_elem); } + // pad0 + Align(&buf, 4); + // glx_extension_string DCHECK_EQ(static_cast(glx_str_len), glx_extension_string.size()); for (auto& glx_extension_string_elem : glx_extension_string) { @@ -2956,6 +2959,9 @@ Future Glx::SetClientInfo2ARB( buf.Write(&gl_extension_string_elem); } + // pad0 + Align(&buf, 4); + // glx_extension_string DCHECK_EQ(static_cast(glx_str_len), glx_extension_string.size()); for (auto& glx_extension_string_elem : glx_extension_string) { diff --git a/ui/gfx/x/generated_protos/randr.cc b/ui/gfx/x/generated_protos/randr.cc index 1b83849a0d9ede..efa0905f0a2ccc 100644 --- a/ui/gfx/x/generated_protos/randr.cc +++ b/ui/gfx/x/generated_protos/randr.cc @@ -56,7 +56,10 @@ RandR::RandR(Connection* connection, const x11::QueryExtensionReply& info) std::string RandR::BadOutputError::ToString() const { std::stringstream ss_; ss_ << "RandR::BadOutputError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -67,6 +70,9 @@ void ReadError(RandR::BadOutputError* error_, auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -79,12 +85,24 @@ void ReadError(RandR::BadOutputError* error_, // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string RandR::BadCrtcError::ToString() const { std::stringstream ss_; ss_ << "RandR::BadCrtcError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -95,6 +113,9 @@ void ReadError(RandR::BadCrtcError* error_, auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -107,12 +128,24 @@ void ReadError(RandR::BadCrtcError* error_, // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string RandR::BadModeError::ToString() const { std::stringstream ss_; ss_ << "RandR::BadModeError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -123,6 +156,9 @@ void ReadError(RandR::BadModeError* error_, auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -135,12 +171,24 @@ void ReadError(RandR::BadModeError* error_, // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string RandR::BadProviderError::ToString() const { std::stringstream ss_; ss_ << "RandR::BadProviderError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -151,6 +199,9 @@ void ReadError(RandR::BadProviderError* error_, auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -163,6 +214,15 @@ void ReadError(RandR::BadProviderError* error_, // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } template <> diff --git a/ui/gfx/x/generated_protos/randr.h b/ui/gfx/x/generated_protos/randr.h index b79aa9aa63d19d..97839536b49993 100644 --- a/ui/gfx/x/generated_protos/randr.h +++ b/ui/gfx/x/generated_protos/randr.h @@ -167,24 +167,36 @@ class COMPONENT_EXPORT(X11) RandR { struct BadOutputError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; struct BadCrtcError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; struct BadModeError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; struct BadProviderError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; diff --git a/ui/gfx/x/generated_protos/read_event.cc b/ui/gfx/x/generated_protos/read_event.cc index bc58a45c01f5d5..ec344cf99153f6 100644 --- a/ui/gfx/x/generated_protos/read_event.cc +++ b/ui/gfx/x/generated_protos/read_event.cc @@ -622,9 +622,43 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { return; } + if (evtype == GeGenericEvent::opcode && conn->xinput().present() && + ge->extension == conn->xinput().major_opcode() && + (ge->event_type == Input::GesturePinchEvent::Begin || + ge->event_type == Input::GesturePinchEvent::Update || + ge->event_type == Input::GesturePinchEvent::End)) { + event->type_id_ = 38; + event->deleter_ = [](void* event) { + delete reinterpret_cast(event); + }; + auto* event_ = new Input::GesturePinchEvent; + ReadEvent(event_, buffer); + event_->opcode = static_castopcode)>(ge->event_type); + event->event_ = event_; + event->window_ = event_->GetWindow(); + return; + } + + if (evtype == GeGenericEvent::opcode && conn->xinput().present() && + ge->extension == conn->xinput().major_opcode() && + (ge->event_type == Input::GestureSwipeEvent::Begin || + ge->event_type == Input::GestureSwipeEvent::Update || + ge->event_type == Input::GestureSwipeEvent::End)) { + event->type_id_ = 39; + event->deleter_ = [](void* event) { + delete reinterpret_cast(event); + }; + auto* event_ = new Input::GestureSwipeEvent; + ReadEvent(event_, buffer); + event_->opcode = static_castopcode)>(ge->event_type); + event->event_ = event_; + event->window_ = event_->GetWindow(); + return; + } + if (conn->xkb().present() && evtype - conn->xkb().first_event() == Xkb::NewKeyboardNotifyEvent::opcode) { - event->type_id_ = 38; + event->type_id_ = 40; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -637,7 +671,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { if (conn->xkb().present() && evtype - conn->xkb().first_event() == Xkb::MapNotifyEvent::opcode) { - event->type_id_ = 39; + event->type_id_ = 41; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -650,7 +684,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { if (conn->xkb().present() && evtype - conn->xkb().first_event() == Xkb::StateNotifyEvent::opcode) { - event->type_id_ = 40; + event->type_id_ = 42; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -663,7 +697,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { if (conn->xkb().present() && evtype - conn->xkb().first_event() == Xkb::ControlsNotifyEvent::opcode) { - event->type_id_ = 41; + event->type_id_ = 43; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -676,7 +710,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { if (conn->xkb().present() && evtype - conn->xkb().first_event() == Xkb::IndicatorStateNotifyEvent::opcode) { - event->type_id_ = 42; + event->type_id_ = 44; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -689,7 +723,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { if (conn->xkb().present() && evtype - conn->xkb().first_event() == Xkb::IndicatorMapNotifyEvent::opcode) { - event->type_id_ = 43; + event->type_id_ = 45; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -702,7 +736,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { if (conn->xkb().present() && evtype - conn->xkb().first_event() == Xkb::NamesNotifyEvent::opcode) { - event->type_id_ = 44; + event->type_id_ = 46; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -715,7 +749,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { if (conn->xkb().present() && evtype - conn->xkb().first_event() == Xkb::CompatMapNotifyEvent::opcode) { - event->type_id_ = 45; + event->type_id_ = 47; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -728,7 +762,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { if (conn->xkb().present() && evtype - conn->xkb().first_event() == Xkb::BellNotifyEvent::opcode) { - event->type_id_ = 46; + event->type_id_ = 48; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -741,7 +775,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { if (conn->xkb().present() && evtype - conn->xkb().first_event() == Xkb::ActionMessageEvent::opcode) { - event->type_id_ = 47; + event->type_id_ = 49; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -754,7 +788,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { if (conn->xkb().present() && evtype - conn->xkb().first_event() == Xkb::AccessXNotifyEvent::opcode) { - event->type_id_ = 48; + event->type_id_ = 50; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -767,7 +801,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { if (conn->xkb().present() && evtype - conn->xkb().first_event() == Xkb::ExtensionDeviceNotifyEvent::opcode) { - event->type_id_ = 49; + event->type_id_ = 51; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -780,7 +814,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { if (conn->xprint().present() && evtype - conn->xprint().first_event() == XPrint::NotifyEvent::opcode) { - event->type_id_ = 50; + event->type_id_ = 52; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -793,7 +827,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { if (conn->xprint().present() && evtype - conn->xprint().first_event() == XPrint::AttributNotifyEvent::opcode) { - event->type_id_ = 51; + event->type_id_ = 53; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -805,7 +839,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if ((evtype == KeyEvent::Press || evtype == KeyEvent::Release)) { - event->type_id_ = 52; + event->type_id_ = 54; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -818,7 +852,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if ((evtype == ButtonEvent::Press || evtype == ButtonEvent::Release)) { - event->type_id_ = 53; + event->type_id_ = 55; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -831,7 +865,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == MotionNotifyEvent::opcode) { - event->type_id_ = 54; + event->type_id_ = 56; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -844,7 +878,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { if ((evtype == CrossingEvent::EnterNotify || evtype == CrossingEvent::LeaveNotify)) { - event->type_id_ = 55; + event->type_id_ = 57; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -857,7 +891,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if ((evtype == FocusEvent::In || evtype == FocusEvent::Out)) { - event->type_id_ = 56; + event->type_id_ = 58; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -870,7 +904,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == KeymapNotifyEvent::opcode) { - event->type_id_ = 57; + event->type_id_ = 59; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -882,7 +916,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == ExposeEvent::opcode) { - event->type_id_ = 58; + event->type_id_ = 60; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -894,7 +928,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == GraphicsExposureEvent::opcode) { - event->type_id_ = 59; + event->type_id_ = 61; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -906,7 +940,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == NoExposureEvent::opcode) { - event->type_id_ = 60; + event->type_id_ = 62; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -918,7 +952,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == VisibilityNotifyEvent::opcode) { - event->type_id_ = 61; + event->type_id_ = 63; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -930,7 +964,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == CreateNotifyEvent::opcode) { - event->type_id_ = 62; + event->type_id_ = 64; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -942,7 +976,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == DestroyNotifyEvent::opcode) { - event->type_id_ = 63; + event->type_id_ = 65; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -954,7 +988,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == UnmapNotifyEvent::opcode) { - event->type_id_ = 64; + event->type_id_ = 66; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -966,7 +1000,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == MapNotifyEvent::opcode) { - event->type_id_ = 65; + event->type_id_ = 67; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -978,7 +1012,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == MapRequestEvent::opcode) { - event->type_id_ = 66; + event->type_id_ = 68; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -990,7 +1024,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == ReparentNotifyEvent::opcode) { - event->type_id_ = 67; + event->type_id_ = 69; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -1002,7 +1036,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == ConfigureNotifyEvent::opcode) { - event->type_id_ = 68; + event->type_id_ = 70; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -1014,7 +1048,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == ConfigureRequestEvent::opcode) { - event->type_id_ = 69; + event->type_id_ = 71; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -1026,7 +1060,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == GravityNotifyEvent::opcode) { - event->type_id_ = 70; + event->type_id_ = 72; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -1038,7 +1072,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == ResizeRequestEvent::opcode) { - event->type_id_ = 71; + event->type_id_ = 73; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -1050,7 +1084,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if ((evtype == CirculateEvent::Notify || evtype == CirculateEvent::Request)) { - event->type_id_ = 72; + event->type_id_ = 74; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -1063,7 +1097,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == PropertyNotifyEvent::opcode) { - event->type_id_ = 73; + event->type_id_ = 75; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -1075,7 +1109,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == SelectionClearEvent::opcode) { - event->type_id_ = 74; + event->type_id_ = 76; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -1087,7 +1121,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == SelectionRequestEvent::opcode) { - event->type_id_ = 75; + event->type_id_ = 77; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -1099,7 +1133,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == SelectionNotifyEvent::opcode) { - event->type_id_ = 76; + event->type_id_ = 78; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -1111,7 +1145,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == ColormapNotifyEvent::opcode) { - event->type_id_ = 77; + event->type_id_ = 79; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -1123,7 +1157,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == ClientMessageEvent::opcode) { - event->type_id_ = 78; + event->type_id_ = 80; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -1135,7 +1169,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { } if (evtype == MappingNotifyEvent::opcode) { - event->type_id_ = 79; + event->type_id_ = 81; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -1148,7 +1182,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { if (conn->xv().present() && evtype - conn->xv().first_event() == Xv::VideoNotifyEvent::opcode) { - event->type_id_ = 81; + event->type_id_ = 83; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; @@ -1161,7 +1195,7 @@ void ReadEvent(Event* event, Connection* conn, ReadBuffer* buffer) { if (conn->xv().present() && evtype - conn->xv().first_event() == Xv::PortNotifyEvent::opcode) { - event->type_id_ = 82; + event->type_id_ = 84; event->deleter_ = [](void* event) { delete reinterpret_cast(event); }; diff --git a/ui/gfx/x/generated_protos/record.cc b/ui/gfx/x/generated_protos/record.cc index 356cce15c1ec7e..7465cae5296324 100644 --- a/ui/gfx/x/generated_protos/record.cc +++ b/ui/gfx/x/generated_protos/record.cc @@ -57,7 +57,9 @@ std::string Record::BadContextError::ToString() const { std::stringstream ss_; ss_ << "Record::BadContextError{"; ss_ << ".sequence = " << static_cast(sequence) << ", "; - ss_ << ".invalid_record = " << static_cast(invalid_record); + ss_ << ".invalid_record = " << static_cast(invalid_record) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -69,6 +71,8 @@ void ReadError(Record::BadContextError* error_, auto& sequence = (*error_).sequence; auto& invalid_record = (*error_).invalid_record; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -84,6 +88,12 @@ void ReadError(Record::BadContextError* error_, // invalid_record Read(&invalid_record, &buf); + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } Future Record::QueryVersion( diff --git a/ui/gfx/x/generated_protos/record.h b/ui/gfx/x/generated_protos/record.h index bc45d19d2dcf3d..dccb50e6cf7866 100644 --- a/ui/gfx/x/generated_protos/record.h +++ b/ui/gfx/x/generated_protos/record.h @@ -158,6 +158,8 @@ class COMPONENT_EXPORT(X11) Record { struct BadContextError : public x11::Error { uint16_t sequence{}; uint32_t invalid_record{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; diff --git a/ui/gfx/x/generated_protos/render.cc b/ui/gfx/x/generated_protos/render.cc index 7784a7b72fd0c2..6910596074316d 100644 --- a/ui/gfx/x/generated_protos/render.cc +++ b/ui/gfx/x/generated_protos/render.cc @@ -56,7 +56,10 @@ Render::Render(Connection* connection, const x11::QueryExtensionReply& info) std::string Render::PictFormatError::ToString() const { std::stringstream ss_; ss_ << "Render::PictFormatError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -67,6 +70,9 @@ void ReadError(Render::PictFormatError* error_, auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -79,12 +85,24 @@ void ReadError(Render::PictFormatError* error_, // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string Render::PictureError::ToString() const { std::stringstream ss_; ss_ << "Render::PictureError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -95,6 +113,9 @@ void ReadError(Render::PictureError* error_, auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -107,12 +128,24 @@ void ReadError(Render::PictureError* error_, // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string Render::PictOpError::ToString() const { std::stringstream ss_; ss_ << "Render::PictOpError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -123,6 +156,9 @@ void ReadError(Render::PictOpError* error_, auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -135,12 +171,24 @@ void ReadError(Render::PictOpError* error_, // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string Render::GlyphSetError::ToString() const { std::stringstream ss_; ss_ << "Render::GlyphSetError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -151,6 +199,9 @@ void ReadError(Render::GlyphSetError* error_, auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -163,12 +214,24 @@ void ReadError(Render::GlyphSetError* error_, // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string Render::GlyphError::ToString() const { std::stringstream ss_; ss_ << "Render::GlyphError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -179,6 +242,9 @@ void ReadError(Render::GlyphError* error_, auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -191,6 +257,15 @@ void ReadError(Render::GlyphError* error_, // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } Future Render::QueryVersion( diff --git a/ui/gfx/x/generated_protos/render.h b/ui/gfx/x/generated_protos/render.h index ea70403380baf4..cd1aba16b585c0 100644 --- a/ui/gfx/x/generated_protos/render.h +++ b/ui/gfx/x/generated_protos/render.h @@ -197,30 +197,45 @@ class COMPONENT_EXPORT(X11) Render { struct PictFormatError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; struct PictureError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; struct PictOpError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; struct GlyphSetError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; struct GlyphError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; diff --git a/ui/gfx/x/generated_protos/xf86vidmode.cc b/ui/gfx/x/generated_protos/xf86vidmode.cc index 509cf8b649c57a..98fb120417cd63 100644 --- a/ui/gfx/x/generated_protos/xf86vidmode.cc +++ b/ui/gfx/x/generated_protos/xf86vidmode.cc @@ -57,7 +57,10 @@ XF86VidMode::XF86VidMode(Connection* connection, std::string XF86VidMode::BadClockError::ToString() const { std::stringstream ss_; ss_ << "XF86VidMode::BadClockError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -68,6 +71,9 @@ void ReadError(XF86VidMode::BadClockError* error_, auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -80,12 +86,24 @@ void ReadError(XF86VidMode::BadClockError* error_, // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string XF86VidMode::BadHTimingsError::ToString() const { std::stringstream ss_; ss_ << "XF86VidMode::BadHTimingsError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -97,6 +115,9 @@ void ReadError( auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -109,12 +130,24 @@ void ReadError( // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string XF86VidMode::BadVTimingsError::ToString() const { std::stringstream ss_; ss_ << "XF86VidMode::BadVTimingsError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -126,6 +159,9 @@ void ReadError( auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -138,12 +174,24 @@ void ReadError( // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string XF86VidMode::ModeUnsuitableError::ToString() const { std::stringstream ss_; ss_ << "XF86VidMode::ModeUnsuitableError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -155,6 +203,9 @@ void ReadError( auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -167,12 +218,24 @@ void ReadError( // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string XF86VidMode::ExtensionDisabledError::ToString() const { std::stringstream ss_; ss_ << "XF86VidMode::ExtensionDisabledError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -184,6 +247,9 @@ void ReadError( auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -196,12 +262,24 @@ void ReadError( // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string XF86VidMode::ClientNotLocalError::ToString() const { std::stringstream ss_; ss_ << "XF86VidMode::ClientNotLocalError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -213,6 +291,9 @@ void ReadError( auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -225,12 +306,24 @@ void ReadError( // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string XF86VidMode::ZoomLockedError::ToString() const { std::stringstream ss_; ss_ << "XF86VidMode::ZoomLockedError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -242,6 +335,9 @@ void ReadError( auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -254,6 +350,15 @@ void ReadError( // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } Future XF86VidMode::QueryVersion( diff --git a/ui/gfx/x/generated_protos/xf86vidmode.h b/ui/gfx/x/generated_protos/xf86vidmode.h index f49b96cabb9df8..b85bfc46a6f0d1 100644 --- a/ui/gfx/x/generated_protos/xf86vidmode.h +++ b/ui/gfx/x/generated_protos/xf86vidmode.h @@ -135,42 +135,63 @@ class COMPONENT_EXPORT(X11) XF86VidMode { struct BadClockError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; struct BadHTimingsError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; struct BadVTimingsError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; struct ModeUnsuitableError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; struct ExtensionDisabledError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; struct ClientNotLocalError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; struct ZoomLockedError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; diff --git a/ui/gfx/x/generated_protos/xfixes.cc b/ui/gfx/x/generated_protos/xfixes.cc index e3b44e684e413d..f0ec6022c4c203 100644 --- a/ui/gfx/x/generated_protos/xfixes.cc +++ b/ui/gfx/x/generated_protos/xfixes.cc @@ -147,7 +147,10 @@ void ReadEvent(XFixes::CursorNotifyEvent* event_, std::string XFixes::BadRegionError::ToString() const { std::stringstream ss_; ss_ << "XFixes::BadRegionError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -158,6 +161,9 @@ void ReadError(XFixes::BadRegionError* error_, auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -170,6 +176,15 @@ void ReadError(XFixes::BadRegionError* error_, // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } Future XFixes::QueryVersion( @@ -1985,4 +2000,110 @@ Future XFixes::DeletePointerBarrier(const Barrier& barrier) { XFixes::DeletePointerBarrierRequest{barrier}); } +Future XFixes::SetClientDisconnectMode( + const XFixes::SetClientDisconnectModeRequest& request) { + if (!connection_->Ready() || !present()) + return {}; + + WriteBuffer buf; + + auto& disconnect_mode = request.disconnect_mode; + + // major_opcode + uint8_t major_opcode = info_.major_opcode; + buf.Write(&major_opcode); + + // minor_opcode + uint8_t minor_opcode = 33; + buf.Write(&minor_opcode); + + // length + // Caller fills in length for writes. + Pad(&buf, sizeof(uint16_t)); + + // disconnect_mode + uint32_t tmp10; + tmp10 = static_cast(disconnect_mode); + buf.Write(&tmp10); + + Align(&buf, 4); + + return connection_->SendRequest(&buf, "XFixes::SetClientDisconnectMode", + false); +} + +Future XFixes::SetClientDisconnectMode( + const ClientDisconnectFlags& disconnect_mode) { + return XFixes::SetClientDisconnectMode( + XFixes::SetClientDisconnectModeRequest{disconnect_mode}); +} + +Future XFixes::GetClientDisconnectMode( + const XFixes::GetClientDisconnectModeRequest& request) { + if (!connection_->Ready() || !present()) + return {}; + + WriteBuffer buf; + + // major_opcode + uint8_t major_opcode = info_.major_opcode; + buf.Write(&major_opcode); + + // minor_opcode + uint8_t minor_opcode = 34; + buf.Write(&minor_opcode); + + // length + // Caller fills in length for writes. + Pad(&buf, sizeof(uint16_t)); + + Align(&buf, 4); + + return connection_->SendRequest( + &buf, "XFixes::GetClientDisconnectMode", false); +} + +Future XFixes::GetClientDisconnectMode() { + return XFixes::GetClientDisconnectMode( + XFixes::GetClientDisconnectModeRequest{}); +} + +template <> +COMPONENT_EXPORT(X11) +std::unique_ptr detail::ReadReply< + XFixes::GetClientDisconnectModeReply>(ReadBuffer* buffer) { + auto& buf = *buffer; + auto reply = std::make_unique(); + + auto& sequence = (*reply).sequence; + auto& disconnect_mode = (*reply).disconnect_mode; + + // response_type + uint8_t response_type; + Read(&response_type, &buf); + + // pad0 + Pad(&buf, 1); + + // sequence + Read(&sequence, &buf); + + // length + uint32_t length; + Read(&length, &buf); + + // disconnect_mode + uint32_t tmp11; + Read(&tmp11, &buf); + disconnect_mode = static_cast(tmp11); + + // pad1 + Pad(&buf, 20); + + Align(&buf, 4); + DCHECK_EQ(buf.offset < 32 ? 0 : buf.offset - 32, 4 * length); + + return reply; +} + } // namespace x11 diff --git a/ui/gfx/x/generated_protos/xfixes.h b/ui/gfx/x/generated_protos/xfixes.h index 75385d0f44aedb..b0aa4b91b9229f 100644 --- a/ui/gfx/x/generated_protos/xfixes.h +++ b/ui/gfx/x/generated_protos/xfixes.h @@ -70,7 +70,7 @@ class Future; class COMPONENT_EXPORT(X11) XFixes { public: - static constexpr unsigned major_version = 5; + static constexpr unsigned major_version = 6; static constexpr unsigned minor_version = 0; XFixes(Connection* connection, const x11::QueryExtensionReply& info); @@ -130,6 +130,11 @@ class COMPONENT_EXPORT(X11) XFixes { NegativeY = 1 << 3, }; + enum class ClientDisconnectFlags : int { + Default = 0, + Terminate = 1 << 0, + }; + struct SelectionNotifyEvent { static constexpr int type_id = 18; static constexpr uint8_t opcode = 0; @@ -159,6 +164,9 @@ class COMPONENT_EXPORT(X11) XFixes { struct BadRegionError : public x11::Error { uint16_t sequence{}; + uint32_t bad_value{}; + uint16_t minor_opcode{}; + uint8_t major_opcode{}; std::string ToString() const override; }; @@ -641,6 +649,33 @@ class COMPONENT_EXPORT(X11) XFixes { Future DeletePointerBarrier(const Barrier& barrier = {}); + struct SetClientDisconnectModeRequest { + ClientDisconnectFlags disconnect_mode{}; + }; + + using SetClientDisconnectModeResponse = Response; + + Future SetClientDisconnectMode( + const SetClientDisconnectModeRequest& request); + + Future SetClientDisconnectMode( + const ClientDisconnectFlags& disconnect_mode = {}); + + struct GetClientDisconnectModeRequest {}; + + struct GetClientDisconnectModeReply { + uint16_t sequence{}; + ClientDisconnectFlags disconnect_mode{}; + }; + + using GetClientDisconnectModeResponse = + Response; + + Future GetClientDisconnectMode( + const GetClientDisconnectModeRequest& request); + + Future GetClientDisconnectMode(); + private: Connection* const connection_; x11::QueryExtensionReply info_{}; @@ -790,4 +825,20 @@ inline constexpr x11::XFixes::BarrierDirections operator&( static_cast(r)); } +inline constexpr x11::XFixes::ClientDisconnectFlags operator|( + x11::XFixes::ClientDisconnectFlags l, + x11::XFixes::ClientDisconnectFlags r) { + using T = std::underlying_type_t; + return static_cast(static_cast(l) | + static_cast(r)); +} + +inline constexpr x11::XFixes::ClientDisconnectFlags operator&( + x11::XFixes::ClientDisconnectFlags l, + x11::XFixes::ClientDisconnectFlags r) { + using T = std::underlying_type_t; + return static_cast(static_cast(l) & + static_cast(r)); +} + #endif // UI_GFX_X_GENERATED_PROTOS_XFIXES_H_ diff --git a/ui/gfx/x/generated_protos/xinput.cc b/ui/gfx/x/generated_protos/xinput.cc index a89a19833445f1..2c4abd63e608e5 100644 --- a/ui/gfx/x/generated_protos/xinput.cc +++ b/ui/gfx/x/generated_protos/xinput.cc @@ -734,6 +734,16 @@ void ReadEvent(Input::DeviceChangedEvent* event_, // num_touches Read(&num_touches, &buf); } + if (CaseEq(data_expr, Input::DeviceClassType::Gesture)) { + data.gesture.emplace(); + auto& num_touches = (*data.gesture).num_touches; + + // num_touches + Read(&num_touches, &buf); + + // pad2 + Pad(&buf, 1); + } } } @@ -1485,10 +1495,305 @@ void ReadEvent(Input::BarrierEvent* event_, DCHECK_EQ(buf.offset, 32 + 4 * length); } +template <> +COMPONENT_EXPORT(X11) +void ReadEvent(Input::GesturePinchEvent* event_, + ReadBuffer* buffer) { + auto& buf = *buffer; + + auto& sequence = (*event_).sequence; + auto& deviceid = (*event_).deviceid; + auto& time = (*event_).time; + auto& detail = (*event_).detail; + auto& root = (*event_).root; + auto& event = (*event_).event; + auto& child = (*event_).child; + auto& root_x = (*event_).root_x; + auto& root_y = (*event_).root_y; + auto& event_x = (*event_).event_x; + auto& event_y = (*event_).event_y; + auto& delta_x = (*event_).delta_x; + auto& delta_y = (*event_).delta_y; + auto& delta_unaccel_x = (*event_).delta_unaccel_x; + auto& delta_unaccel_y = (*event_).delta_unaccel_y; + auto& scale = (*event_).scale; + auto& delta_angle = (*event_).delta_angle; + auto& sourceid = (*event_).sourceid; + auto& mods = (*event_).mods; + auto& group = (*event_).group; + auto& flags = (*event_).flags; + + // response_type + uint8_t response_type; + Read(&response_type, &buf); + + // extension + uint8_t extension; + Read(&extension, &buf); + + // sequence + Read(&sequence, &buf); + + // length + uint32_t length; + Read(&length, &buf); + + // event_type + uint16_t event_type; + Read(&event_type, &buf); + + // deviceid + Read(&deviceid, &buf); + + // time + Read(&time, &buf); + + // detail + Read(&detail, &buf); + + // root + Read(&root, &buf); + + // event + Read(&event, &buf); + + // child + Read(&child, &buf); + + // root_x + Read(&root_x, &buf); + + // root_y + Read(&root_y, &buf); + + // event_x + Read(&event_x, &buf); + + // event_y + Read(&event_y, &buf); + + // delta_x + Read(&delta_x, &buf); + + // delta_y + Read(&delta_y, &buf); + + // delta_unaccel_x + Read(&delta_unaccel_x, &buf); + + // delta_unaccel_y + Read(&delta_unaccel_y, &buf); + + // scale + Read(&scale, &buf); + + // delta_angle + Read(&delta_angle, &buf); + + // sourceid + Read(&sourceid, &buf); + + // pad0 + Pad(&buf, 2); + + // mods + { + auto& base = mods.base; + auto& latched = mods.latched; + auto& locked = mods.locked; + auto& effective = mods.effective; + + // base + Read(&base, &buf); + + // latched + Read(&latched, &buf); + + // locked + Read(&locked, &buf); + + // effective + Read(&effective, &buf); + } + + // group + { + auto& base = group.base; + auto& latched = group.latched; + auto& locked = group.locked; + auto& effective = group.effective; + + // base + Read(&base, &buf); + + // latched + Read(&latched, &buf); + + // locked + Read(&locked, &buf); + + // effective + Read(&effective, &buf); + } + + // flags + uint32_t tmp27; + Read(&tmp27, &buf); + flags = static_cast(tmp27); + + Align(&buf, 4); + DCHECK_EQ(buf.offset, 32 + 4 * length); +} + +template <> +COMPONENT_EXPORT(X11) +void ReadEvent(Input::GestureSwipeEvent* event_, + ReadBuffer* buffer) { + auto& buf = *buffer; + + auto& sequence = (*event_).sequence; + auto& deviceid = (*event_).deviceid; + auto& time = (*event_).time; + auto& detail = (*event_).detail; + auto& root = (*event_).root; + auto& event = (*event_).event; + auto& child = (*event_).child; + auto& root_x = (*event_).root_x; + auto& root_y = (*event_).root_y; + auto& event_x = (*event_).event_x; + auto& event_y = (*event_).event_y; + auto& delta_x = (*event_).delta_x; + auto& delta_y = (*event_).delta_y; + auto& delta_unaccel_x = (*event_).delta_unaccel_x; + auto& delta_unaccel_y = (*event_).delta_unaccel_y; + auto& sourceid = (*event_).sourceid; + auto& mods = (*event_).mods; + auto& group = (*event_).group; + auto& flags = (*event_).flags; + + // response_type + uint8_t response_type; + Read(&response_type, &buf); + + // extension + uint8_t extension; + Read(&extension, &buf); + + // sequence + Read(&sequence, &buf); + + // length + uint32_t length; + Read(&length, &buf); + + // event_type + uint16_t event_type; + Read(&event_type, &buf); + + // deviceid + Read(&deviceid, &buf); + + // time + Read(&time, &buf); + + // detail + Read(&detail, &buf); + + // root + Read(&root, &buf); + + // event + Read(&event, &buf); + + // child + Read(&child, &buf); + + // root_x + Read(&root_x, &buf); + + // root_y + Read(&root_y, &buf); + + // event_x + Read(&event_x, &buf); + + // event_y + Read(&event_y, &buf); + + // delta_x + Read(&delta_x, &buf); + + // delta_y + Read(&delta_y, &buf); + + // delta_unaccel_x + Read(&delta_unaccel_x, &buf); + + // delta_unaccel_y + Read(&delta_unaccel_y, &buf); + + // sourceid + Read(&sourceid, &buf); + + // pad0 + Pad(&buf, 2); + + // mods + { + auto& base = mods.base; + auto& latched = mods.latched; + auto& locked = mods.locked; + auto& effective = mods.effective; + + // base + Read(&base, &buf); + + // latched + Read(&latched, &buf); + + // locked + Read(&locked, &buf); + + // effective + Read(&effective, &buf); + } + + // group + { + auto& base = group.base; + auto& latched = group.latched; + auto& locked = group.locked; + auto& effective = group.effective; + + // base + Read(&base, &buf); + + // latched + Read(&latched, &buf); + + // locked + Read(&locked, &buf); + + // effective + Read(&effective, &buf); + } + + // flags + uint32_t tmp28; + Read(&tmp28, &buf); + flags = static_cast(tmp28); + + Align(&buf, 4); + DCHECK_EQ(buf.offset, 32 + 4 * length); +} + std::string Input::DeviceError::ToString() const { std::stringstream ss_; ss_ << "Input::DeviceError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -1499,6 +1804,9 @@ void ReadError(Input::DeviceError* error_, auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -1511,12 +1819,24 @@ void ReadError(Input::DeviceError* error_, // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string Input::EventError::ToString() const { std::stringstream ss_; ss_ << "Input::EventError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -1527,6 +1847,9 @@ void ReadError(Input::EventError* error_, auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -1539,12 +1862,24 @@ void ReadError(Input::EventError* error_, // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string Input::ModeError::ToString() const { std::stringstream ss_; ss_ << "Input::ModeError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -1554,6 +1889,9 @@ void ReadError(Input::ModeError* error_, ReadBuffer* buffer) { auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -1566,12 +1904,24 @@ void ReadError(Input::ModeError* error_, ReadBuffer* buffer) { // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string Input::DeviceBusyError::ToString() const { std::stringstream ss_; ss_ << "Input::DeviceBusyError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -1582,6 +1932,9 @@ void ReadError(Input::DeviceBusyError* error_, auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -1594,12 +1947,24 @@ void ReadError(Input::DeviceBusyError* error_, // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } std::string Input::ClassError::ToString() const { std::stringstream ss_; ss_ << "Input::ClassError{"; - ss_ << ".sequence = " << static_cast(sequence); + ss_ << ".sequence = " << static_cast(sequence) << ", "; + ss_ << ".bad_value = " << static_cast(bad_value) << ", "; + ss_ << ".minor_opcode = " << static_cast(minor_opcode) << ", "; + ss_ << ".major_opcode = " << static_cast(major_opcode); ss_ << "}"; return ss_.str(); } @@ -1610,6 +1975,9 @@ void ReadError(Input::ClassError* error_, auto& buf = *buffer; auto& sequence = (*error_).sequence; + auto& bad_value = (*error_).bad_value; + auto& minor_opcode = (*error_).minor_opcode; + auto& major_opcode = (*error_).major_opcode; // response_type uint8_t response_type; @@ -1622,6 +1990,15 @@ void ReadError(Input::ClassError* error_, // sequence Read(&sequence, &buf); + // bad_value + Read(&bad_value, &buf); + + // minor_opcode + Read(&minor_opcode, &buf); + + // major_opcode + Read(&major_opcode, &buf); + DCHECK_LE(buf.offset, 32ul); } Future Input::GetExtensionVersion( @@ -1801,9 +2178,9 @@ std::unique_ptr detail::ReadReply< Read(&num_class_info, &buf); // device_use - uint8_t tmp27; - Read(&tmp27, &buf); - device_use = static_cast(tmp27); + uint8_t tmp29; + Read(&tmp29, &buf); + device_use = static_cast(tmp29); // pad0 Pad(&buf, 1); @@ -1811,7 +2188,7 @@ std::unique_ptr detail::ReadReply< } // infos - auto sum28_ = SumOf( + auto sum30_ = SumOf( [](auto& listelem_ref) { auto& device_type = listelem_ref.device_type; auto& device_id = listelem_ref.device_id; @@ -1821,7 +2198,7 @@ std::unique_ptr detail::ReadReply< return num_class_info; }, devices); - infos.resize(sum28_); + infos.resize(sum30_); for (auto& infos_elem : infos) { // infos_elem { @@ -1830,9 +2207,9 @@ std::unique_ptr detail::ReadReply< auto& info = infos_elem; // class_id - uint8_t tmp29; - Read(&tmp29, &buf); - class_id = static_cast(tmp29); + uint8_t tmp31; + Read(&tmp31, &buf); + class_id = static_cast(tmp31); // len Read(&len, &buf); @@ -1875,9 +2252,9 @@ std::unique_ptr detail::ReadReply< Read(&axes_len, &buf); // mode - uint8_t tmp30; - Read(&tmp30, &buf); - mode = static_cast(tmp30); + uint8_t tmp32; + Read(&tmp32, &buf); + mode = static_cast(tmp32); // motion_size Read(&motion_size, &buf); @@ -2013,9 +2390,9 @@ std::unique_ptr detail::ReadReply< auto& event_type_base = class_info_elem.event_type_base; // class_id - uint8_t tmp31; - Read(&tmp31, &buf); - class_id = static_cast(tmp31); + uint8_t tmp33; + Read(&tmp33, &buf); + class_id = static_cast(tmp33); // event_type_base Read(&event_type_base, &buf); @@ -2092,9 +2469,9 @@ Future Input::SetDeviceMode( buf.Write(&device_id); // mode - uint8_t tmp32; - tmp32 = static_cast(mode); - buf.Write(&tmp32); + uint8_t tmp34; + tmp34 = static_cast(mode); + buf.Write(&tmp34); // pad0 Pad(&buf, 2); @@ -2137,9 +2514,9 @@ std::unique_ptr detail::ReadReply< Read(&length, &buf); // status - uint8_t tmp33; - Read(&tmp33, &buf); - status = static_cast(tmp33); + uint8_t tmp35; + Read(&tmp35, &buf); + status = static_cast(tmp35); // pad0 Pad(&buf, 23); @@ -2333,9 +2710,9 @@ Future Input::ChangeDeviceDontPropagateList( buf.Write(&num_classes); // mode - uint8_t tmp34; - tmp34 = static_cast(mode); - buf.Write(&tmp34); + uint8_t tmp36; + tmp36 = static_cast(mode); + buf.Write(&tmp36); // pad0 Pad(&buf, 1); @@ -2529,9 +2906,9 @@ std::unique_ptr detail::ReadReply< Read(&num_axes, &buf); // device_mode - uint8_t tmp35; - Read(&tmp35, &buf); - device_mode = static_cast(tmp35); + uint8_t tmp37; + Read(&tmp37, &buf); + device_mode = static_cast(tmp37); // pad0 Pad(&buf, 18); @@ -2628,9 +3005,9 @@ std::unique_ptr detail::ReadReply< Read(&length, &buf); // status - uint8_t tmp36; - Read(&tmp36, &buf); - status = static_cast(tmp36); + uint8_t tmp38; + Read(&tmp38, &buf); + status = static_cast(tmp38); // pad0 Pad(&buf, 23); @@ -2716,9 +3093,9 @@ std::unique_ptr detail::ReadReply< Read(&length, &buf); // status - uint8_t tmp37; - Read(&tmp37, &buf); - status = static_cast(tmp37); + uint8_t tmp39; + Read(&tmp39, &buf); + status = static_cast(tmp39); // pad0 Pad(&buf, 23); @@ -2769,14 +3146,14 @@ Future Input::GrabDevice( buf.Write(&num_classes); // this_device_mode - uint8_t tmp38; - tmp38 = static_cast(this_device_mode); - buf.Write(&tmp38); + uint8_t tmp40; + tmp40 = static_cast(this_device_mode); + buf.Write(&tmp40); // other_device_mode - uint8_t tmp39; - tmp39 = static_cast(other_device_mode); - buf.Write(&tmp39); + uint8_t tmp41; + tmp41 = static_cast(other_device_mode); + buf.Write(&tmp41); // owner_events buf.Write(&owner_events); @@ -2839,9 +3216,9 @@ std::unique_ptr detail::ReadReply< Read(&length, &buf); // status - uint8_t tmp40; - Read(&tmp40, &buf); - status = static_cast(tmp40); + uint8_t tmp42; + Read(&tmp42, &buf); + status = static_cast(tmp42); // pad0 Pad(&buf, 23); @@ -2929,9 +3306,9 @@ Future Input::GrabDeviceKey(const Input::GrabDeviceKeyRequest& request) { buf.Write(&num_classes); // modifiers - uint16_t tmp41; - tmp41 = static_cast(modifiers); - buf.Write(&tmp41); + uint16_t tmp43; + tmp43 = static_cast(modifiers); + buf.Write(&tmp43); // modifier_device buf.Write(&modifier_device); @@ -2943,14 +3320,14 @@ Future Input::GrabDeviceKey(const Input::GrabDeviceKeyRequest& request) { buf.Write(&key); // this_device_mode - uint8_t tmp42; - tmp42 = static_cast(this_device_mode); - buf.Write(&tmp42); + uint8_t tmp44; + tmp44 = static_cast(this_device_mode); + buf.Write(&tmp44); // other_device_mode - uint8_t tmp43; - tmp43 = static_cast(other_device_mode); - buf.Write(&tmp43); + uint8_t tmp45; + tmp45 = static_cast(other_device_mode); + buf.Write(&tmp45); // owner_events buf.Write(&owner_events); @@ -3013,9 +3390,9 @@ Future Input::UngrabDeviceKey( buf.Write(&grabWindow); // modifiers - uint16_t tmp44; - tmp44 = static_cast(modifiers); - buf.Write(&tmp44); + uint16_t tmp46; + tmp46 = static_cast(modifiers); + buf.Write(&tmp46); // modifier_device buf.Write(&modifier_device); @@ -3085,19 +3462,19 @@ Future Input::GrabDeviceButton( buf.Write(&num_classes); // modifiers - uint16_t tmp45; - tmp45 = static_cast(modifiers); - buf.Write(&tmp45); + uint16_t tmp47; + tmp47 = static_cast(modifiers); + buf.Write(&tmp47); // this_device_mode - uint8_t tmp46; - tmp46 = static_cast(this_device_mode); - buf.Write(&tmp46); + uint8_t tmp48; + tmp48 = static_cast(this_device_mode); + buf.Write(&tmp48); // other_device_mode - uint8_t tmp47; - tmp47 = static_cast(other_device_mode); - buf.Write(&tmp47); + uint8_t tmp49; + tmp49 = static_cast(other_device_mode); + buf.Write(&tmp49); // button buf.Write(&button); @@ -3163,9 +3540,9 @@ Future Input::UngrabDeviceButton( buf.Write(&grab_window); // modifiers - uint16_t tmp48; - tmp48 = static_cast(modifiers); - buf.Write(&tmp48); + uint16_t tmp50; + tmp50 = static_cast(modifiers); + buf.Write(&tmp50); // modifier_device buf.Write(&modifier_device); @@ -3221,9 +3598,9 @@ Future Input::AllowDeviceEvents( buf.Write(&time); // mode - uint8_t tmp49; - tmp49 = static_cast(mode); - buf.Write(&tmp49); + uint8_t tmp51; + tmp51 = static_cast(mode); + buf.Write(&tmp51); // device_id buf.Write(&device_id); @@ -3316,9 +3693,9 @@ std::unique_ptr detail::ReadReply< Read(&time, &buf); // revert_to - uint8_t tmp50; - Read(&tmp50, &buf); - revert_to = static_cast(tmp50); + uint8_t tmp52; + Read(&tmp52, &buf); + revert_to = static_cast(tmp52); // pad0 Pad(&buf, 15); @@ -3360,9 +3737,9 @@ Future Input::SetDeviceFocus( buf.Write(&time); // revert_to - uint8_t tmp51; - tmp51 = static_cast(revert_to); - buf.Write(&tmp51); + uint8_t tmp53; + tmp53 = static_cast(revert_to); + buf.Write(&tmp53); // device_id buf.Write(&device_id); @@ -3465,9 +3842,9 @@ std::unique_ptr detail::ReadReply< auto& data = feedbacks_elem; // class_id - uint8_t tmp52; - Read(&tmp52, &buf); - class_id = static_cast(tmp52); + uint8_t tmp54; + Read(&tmp54, &buf); + class_id = static_cast(tmp54); // feedback_id Read(&feedback_id, &buf); @@ -3635,9 +4012,9 @@ Future Input::ChangeFeedbackControl( Pad(&buf, sizeof(uint16_t)); // mask - uint32_t tmp53; - tmp53 = static_cast(mask); - buf.Write(&tmp53); + uint32_t tmp55; + tmp55 = static_cast(mask); + buf.Write(&tmp55); // device_id buf.Write(&device_id); @@ -3665,9 +4042,9 @@ Future Input::ChangeFeedbackControl( &class_id); SwitchVar(FeedbackClass::Led, data.led.has_value(), false, &class_id); SwitchVar(FeedbackClass::Bell, data.bell.has_value(), false, &class_id); - uint8_t tmp54; - tmp54 = static_cast(class_id); - buf.Write(&tmp54); + uint8_t tmp56; + tmp56 = static_cast(class_id); + buf.Write(&tmp56); // feedback_id buf.Write(&feedback_id); @@ -4117,9 +4494,9 @@ std::unique_ptr detail::ReadReply< Read(&length, &buf); // status - uint8_t tmp55; - Read(&tmp55, &buf); - status = static_cast(tmp55); + uint8_t tmp57; + Read(&tmp57, &buf); + status = static_cast(tmp57); // pad0 Pad(&buf, 23); @@ -4298,9 +4675,9 @@ std::unique_ptr detail::ReadReply< Read(&length, &buf); // status - uint8_t tmp56; - Read(&tmp56, &buf); - status = static_cast(tmp56); + uint8_t tmp58; + Read(&tmp58, &buf); + status = static_cast(tmp58); // pad0 Pad(&buf, 23); @@ -4392,9 +4769,9 @@ std::unique_ptr detail::ReadReply< auto& data = classes_elem; // class_id - uint8_t tmp57; - Read(&tmp57, &buf); - class_id = static_cast(tmp57); + uint8_t tmp59; + Read(&tmp59, &buf); + class_id = static_cast(tmp59); // len Read(&len, &buf); @@ -4448,9 +4825,9 @@ std::unique_ptr detail::ReadReply< Read(&num_valuators, &buf); // mode - uint8_t tmp58; - Read(&tmp58, &buf); - mode = static_cast(tmp58); + uint8_t tmp60; + Read(&tmp60, &buf); + mode = static_cast(tmp60); // valuators valuators.resize(num_valuators); @@ -4601,9 +4978,9 @@ std::unique_ptr detail::ReadReply< Read(&length, &buf); // status - uint8_t tmp59; - Read(&tmp59, &buf); - status = static_cast(tmp59); + uint8_t tmp61; + Read(&tmp61, &buf); + status = static_cast(tmp61); // pad0 Pad(&buf, 23); @@ -4637,9 +5014,9 @@ Future Input::GetDeviceControl( Pad(&buf, sizeof(uint16_t)); // control_id - uint16_t tmp60; - tmp60 = static_cast(control_id); - buf.Write(&tmp60); + uint16_t tmp62; + tmp62 = static_cast(control_id); + buf.Write(&tmp62); // device_id buf.Write(&device_id); @@ -4699,9 +5076,9 @@ std::unique_ptr detail::ReadReply< auto& data = control; // control_id - uint16_t tmp61; - Read(&tmp61, &buf); - control_id = static_cast(tmp61); + uint16_t tmp63; + Read(&tmp63, &buf); + control_id = static_cast(tmp63); // len Read(&len, &buf); @@ -4860,9 +5237,9 @@ Future Input::ChangeDeviceControl( Pad(&buf, sizeof(uint16_t)); // control_id - uint16_t tmp62; - tmp62 = static_cast(control_id); - buf.Write(&tmp62); + uint16_t tmp64; + tmp64 = static_cast(control_id); + buf.Write(&tmp64); // device_id buf.Write(&device_id); @@ -4886,9 +5263,9 @@ Future Input::ChangeDeviceControl( &control_id); SwitchVar(DeviceControl::abs_area, data.abs_area.has_value(), false, &control_id); - uint16_t tmp63; - tmp63 = static_cast(control_id); - buf.Write(&tmp63); + uint16_t tmp65; + tmp65 = static_cast(control_id); + buf.Write(&tmp65); // len buf.Write(&len); @@ -5174,14 +5551,14 @@ Future Input::ChangeDeviceProperty( SwitchVar(PropertyFormat::c_8Bits, items.data8.has_value(), false, &format); SwitchVar(PropertyFormat::c_16Bits, items.data16.has_value(), false, &format); SwitchVar(PropertyFormat::c_32Bits, items.data32.has_value(), false, &format); - uint8_t tmp64; - tmp64 = static_cast(format); - buf.Write(&tmp64); + uint8_t tmp66; + tmp66 = static_cast(format); + buf.Write(&tmp66); // mode - uint8_t tmp65; - tmp65 = static_cast(mode); - buf.Write(&tmp65); + uint8_t tmp67; + tmp67 = static_cast(mode); + buf.Write(&tmp67); // pad0 Pad(&buf, 1); @@ -5397,9 +5774,9 @@ std::unique_ptr detail::ReadReply< Read(&num_items, &buf); // format - uint8_t tmp66; - Read(&tmp66, &buf); - format = static_cast(tmp66); + uint8_t tmp68; + Read(&tmp68, &buf); + format = static_cast(tmp68); // device_id Read(&device_id, &buf); @@ -5787,9 +6164,9 @@ Future Input::XIChangeHierarchy( false, &type); SwitchVar(HierarchyChangeType::DetachSlave, data.detach_slave.has_value(), false, &type); - uint16_t tmp67; - tmp67 = static_cast(type); - buf.Write(&tmp67); + uint16_t tmp69; + tmp69 = static_cast(type); + buf.Write(&tmp69); // len buf.Write(&len); @@ -5832,9 +6209,9 @@ Future Input::XIChangeHierarchy( buf.Write(&deviceid); // return_mode - uint8_t tmp68; - tmp68 = static_cast(return_mode); - buf.Write(&tmp68); + uint8_t tmp70; + tmp70 = static_cast(return_mode); + buf.Write(&tmp70); // pad1 Pad(&buf, 1); @@ -6053,9 +6430,9 @@ Future Input::XISelectEvents( DCHECK_EQ(static_cast(mask_len), mask.size()); for (auto& mask_elem : mask) { // mask_elem - uint32_t tmp69; - tmp69 = static_cast(mask_elem); - buf.Write(&tmp69); + uint32_t tmp71; + tmp71 = static_cast(mask_elem); + buf.Write(&tmp71); } } } @@ -6240,9 +6617,9 @@ std::unique_ptr detail::ReadReply< Read(&deviceid, &buf); // type - uint16_t tmp70; - Read(&tmp70, &buf); - type = static_cast(tmp70); + uint16_t tmp72; + Read(&tmp72, &buf); + type = static_cast(tmp72); // attachment Read(&attachment, &buf); @@ -6280,9 +6657,9 @@ std::unique_ptr detail::ReadReply< auto& data = classes_elem; // type - uint16_t tmp71; - Read(&tmp71, &buf); - type = static_cast(tmp71); + uint16_t tmp73; + Read(&tmp73, &buf); + type = static_cast(tmp73); // len Read(&len, &buf); @@ -6389,9 +6766,9 @@ std::unique_ptr detail::ReadReply< Read(&resolution, &buf); // mode - uint8_t tmp72; - Read(&tmp72, &buf); - mode = static_cast(tmp72); + uint8_t tmp74; + Read(&tmp74, &buf); + mode = static_cast(tmp74); // pad0 Pad(&buf, 3); @@ -6407,17 +6784,17 @@ std::unique_ptr detail::ReadReply< Read(&number, &buf); // scroll_type - uint16_t tmp73; - Read(&tmp73, &buf); - scroll_type = static_cast(tmp73); + uint16_t tmp75; + Read(&tmp75, &buf); + scroll_type = static_cast(tmp75); // pad1 Pad(&buf, 2); // flags - uint32_t tmp74; - Read(&tmp74, &buf); - flags = static_cast(tmp74); + uint32_t tmp76; + Read(&tmp76, &buf); + flags = static_cast(tmp76); // increment { @@ -6437,13 +6814,23 @@ std::unique_ptr detail::ReadReply< auto& num_touches = (*data.touch).num_touches; // mode - uint8_t tmp75; - Read(&tmp75, &buf); - mode = static_cast(tmp75); + uint8_t tmp77; + Read(&tmp77, &buf); + mode = static_cast(tmp77); // num_touches Read(&num_touches, &buf); } + if (CaseEq(data_expr, Input::DeviceClassType::Gesture)) { + data.gesture.emplace(); + auto& num_touches = (*data.gesture).num_touches; + + // num_touches + Read(&num_touches, &buf); + + // pad2 + Pad(&buf, 1); + } } } } @@ -6615,19 +7002,19 @@ Future Input::XIGrabDevice( buf.Write(&deviceid); // mode - uint8_t tmp76; - tmp76 = static_cast(mode); - buf.Write(&tmp76); + uint8_t tmp78; + tmp78 = static_cast(mode); + buf.Write(&tmp78); // paired_device_mode - uint8_t tmp77; - tmp77 = static_cast(paired_device_mode); - buf.Write(&tmp77); + uint8_t tmp79; + tmp79 = static_cast(paired_device_mode); + buf.Write(&tmp79); // owner_events - uint8_t tmp78; - tmp78 = static_cast(owner_events); - buf.Write(&tmp78); + uint8_t tmp80; + tmp80 = static_cast(owner_events); + buf.Write(&tmp80); // pad0 Pad(&buf, 1); @@ -6688,9 +7075,9 @@ std::unique_ptr detail::ReadReply< Read(&length, &buf); // status - uint8_t tmp79; - Read(&tmp79, &buf); - status = static_cast(tmp79); + uint8_t tmp81; + Read(&tmp81, &buf); + status = static_cast(tmp81); // pad1 Pad(&buf, 23); @@ -6772,9 +7159,9 @@ Future Input::XIAllowEvents(const Input::XIAllowEventsRequest& request) { buf.Write(&deviceid); // event_mode - uint8_t tmp80; - tmp80 = static_cast(event_mode); - buf.Write(&tmp80); + uint8_t tmp82; + tmp82 = static_cast(event_mode); + buf.Write(&tmp82); // pad0 Pad(&buf, 1); @@ -6857,24 +7244,24 @@ Future Input::XIPassiveGrabDevice( buf.Write(&mask_len); // grab_type - uint8_t tmp81; - tmp81 = static_cast(grab_type); - buf.Write(&tmp81); + uint8_t tmp83; + tmp83 = static_cast(grab_type); + buf.Write(&tmp83); // grab_mode - uint8_t tmp82; - tmp82 = static_cast(grab_mode); - buf.Write(&tmp82); + uint8_t tmp84; + tmp84 = static_cast(grab_mode); + buf.Write(&tmp84); // paired_device_mode - uint8_t tmp83; - tmp83 = static_cast(paired_device_mode); - buf.Write(&tmp83); + uint8_t tmp85; + tmp85 = static_cast(paired_device_mode); + buf.Write(&tmp85); // owner_events - uint8_t tmp84; - tmp84 = static_cast(owner_events); - buf.Write(&tmp84); + uint8_t tmp86; + tmp86 = static_cast(owner_events); + buf.Write(&tmp86); // pad0 Pad(&buf, 2); @@ -6960,9 +7347,9 @@ std::unique_ptr detail::ReadReply< Read(&modifiers, &buf); // status - uint8_t tmp85; - Read(&tmp85, &buf); - status = static_cast(tmp85); + uint8_t tmp87; + Read(&tmp87, &buf); + status = static_cast(tmp87); // pad0 Pad(&buf, 3); @@ -7016,9 +7403,9 @@ Future Input::XIPassiveUngrabDevice( buf.Write(&num_modifiers); // grab_type - uint8_t tmp86; - tmp86 = static_cast(grab_type); - buf.Write(&tmp86); + uint8_t tmp88; + tmp88 = static_cast(grab_type); + buf.Write(&tmp88); // pad0 Pad(&buf, 3); @@ -7160,17 +7547,17 @@ Future Input::XIChangeProperty( buf.Write(&deviceid); // mode - uint8_t tmp87; - tmp87 = static_cast(mode); - buf.Write(&tmp87); + uint8_t tmp89; + tmp89 = static_cast(mode); + buf.Write(&tmp89); // format SwitchVar(PropertyFormat::c_8Bits, items.data8.has_value(), false, &format); SwitchVar(PropertyFormat::c_16Bits, items.data16.has_value(), false, &format); SwitchVar(PropertyFormat::c_32Bits, items.data32.has_value(), false, &format); - uint8_t tmp88; - tmp88 = static_cast(format); - buf.Write(&tmp88); + uint8_t tmp90; + tmp90 = static_cast(format); + buf.Write(&tmp90); // property buf.Write(&property); @@ -7384,9 +7771,9 @@ std::unique_ptr detail::ReadReply< Read(&num_items, &buf); // format - uint8_t tmp89; - Read(&tmp89, &buf); - format = static_cast(tmp89); + uint8_t tmp91; + Read(&tmp91, &buf); + format = static_cast(tmp91); // pad1 Pad(&buf, 11); @@ -7528,9 +7915,9 @@ std::unique_ptr detail::ReadReply< mask.resize(mask_len); for (auto& mask_elem : mask) { // mask_elem - uint32_t tmp90; - Read(&tmp90, &buf); - mask_elem = static_cast(tmp90); + uint32_t tmp92; + Read(&tmp92, &buf); + mask_elem = static_cast(tmp92); } } } diff --git a/ui/gfx/x/generated_protos/xinput.h b/ui/gfx/x/generated_protos/xinput.h index 1c9b676d545896..31651f2ad244f5 100644 --- a/ui/gfx/x/generated_protos/xinput.h +++ b/ui/gfx/x/generated_protos/xinput.h @@ -70,7 +70,7 @@ class Future; class COMPONENT_EXPORT(X11) Input { public: static constexpr unsigned major_version = 2; - static constexpr unsigned minor_version = 3; + static constexpr unsigned minor_version = 4; Input(Connection* connection, const x11::QueryExtensionReply& info); @@ -226,6 +226,7 @@ class COMPONENT_EXPORT(X11) Input { Valuator = 2, Scroll = 3, Touch = 8, + Gesture = 9, }; enum class DeviceType : int { @@ -279,6 +280,8 @@ class COMPONENT_EXPORT(X11) Input { Enter = 2, FocusIn = 3, TouchBegin = 4, + GesturePinchBegin = 5, + GestureSwipeBegin = 6, }; enum class ModifierMask : int { @@ -375,6 +378,14 @@ class COMPONENT_EXPORT(X11) Input { DeviceIsGrabbed = 1 << 1, }; + enum class GesturePinchEventFlags : int { + GesturePinchCancelled = 1 << 0, + }; + + enum class GestureSwipeEventFlags : int { + GestureSwipeCancelled = 1 << 0, + }; + struct Fp3232 { bool operator==(const Fp3232& other) const { return integral == other.integral && frac == other.frac; @@ -1222,6 +1233,18 @@ class COMPONENT_EXPORT(X11) Input { uint8_t num_touches{}; }; + struct GestureClass { + bool operator==(const GestureClass& other) const { + return type == other.type && len == other.len && + sourceid == other.sourceid && num_touches == other.num_touches; + } + + DeviceClassType type{}; + uint16_t len{}; + DeviceId sourceid{}; + uint8_t num_touches{}; + }; + struct ValuatorClass { bool operator==(const ValuatorClass& other) const { return type == other.type && len == other.len && @@ -1272,11 +1295,15 @@ class COMPONENT_EXPORT(X11) Input { TouchMode mode{}; uint8_t num_touches{}; }; + struct Gesture { + uint8_t num_touches{}; + }; absl::optional key{}; absl::optional