1. 03 Jul, 2022 1 commit
  2. 17 Jun, 2022 4 commits
  3. 16 Jun, 2022 2 commits
  4. 27 May, 2022 1 commit
  5. 03 May, 2022 1 commit
  6. 21 Dec, 2021 1 commit
  7. 17 Nov, 2021 1 commit
  8. 04 Oct, 2021 1 commit
  9. 30 Sep, 2021 2 commits
    • Uli Schlachter's avatar
      Use xml.etree.cElementTree where appropriate · 65169c1a
      Uli Schlachter authored
      
      
      This makes the code added in the previous commit consistent with the
      rest of the code base. From Björn's suggestion:
      
        This should import xml.etree.{,c}ElementTree conditionally on the
        version of the Python interpreter used to import this module.
      
        xml.etree.ElementTree is preferred for Python >= 3.3, as it uses the
        fastest possible implementation automatically. Earlier versions of
        Python need xml.etree.cElementTree as they may not have an
        implementation that can be used in a platform generic way.
      Suggested-by: Björn Esser's avatarBjörn Esser <besser82@fedoraproject.org>
      65169c1a
    • Uli Schlachter's avatar
      Add missing fields to errors · 6d72110e
      Uli Schlachter authored
      All X11 errors have the same fields. There are no differences.
      
      In a perfect world, the XML could thus just say "define an error" and
      xcbgen would do all the rest. However, the world is imperfect and we
      already have a mixture of fields defined in the XML. Some of the XML
      even defines trailing padding, while most does not.
      
      This commit makes xcbgen add all fields to X11 errors, but those that
      are already defined in the XML are skipped and left as-is. Due to the
      structure of the code, this requires pretending that a different XML was
      read, i.e. the code now modifies the in-memory structure of ElementTree
      to add the missing fields to the in-memory representation of the XML.
      This is the simplest way that I found to append elements. The existing
      mechanisms can only prepend fields.
      
      The approach taken by this commit was suggested by Peter Harris. Thanks
      a lot for this idea, it's a lot simpler than my previous approach.
      
      Fixes: #16
      
      Signed-off-by: Uli Schlachter's avatarUli Schlachter <psychon@znc.in>
      6d72110e
  10. 22 Sep, 2021 1 commit
    • Povilas Kanapickas's avatar
      xinput: Add XI v2.4 · 151ee698
      Povilas Kanapickas authored
      XInput 2.4 introduces touchpad gesture support which includes 6 new
      events: Gesture{Pinch,Swipe}{Begin,Update,End}.
      151ee698
  11. 02 Sep, 2021 2 commits
    • Povilas Kanapickas's avatar
    • Povilas Kanapickas's avatar
      Add element to specify expression that defines length of a struct · c36dde3f
      Povilas Kanapickas authored
      Currently the layout of a struct is used to compute its size. This works
      fine in case of structs of fixed size. However this introduces
      forwards-compatibility problems in cases when the struct has multiple
      variants and the exact variant is specified by the value of some field
      (e.g. in the case of <switch> elements). Future revisions of protocols
      may introduce new layout variants, in which case the old code does not
      know the size of the struct variant and can't parse the incoming byte
      stream.
      
      Instead of relying on knowledge about the layout of data structures we
      should instead use the length field for length information. This way
      when old client libxcb communicates with newer server it can at least
      ignore unknown struct variants.
      c36dde3f
  12. 22 Jul, 2021 1 commit
    • Olivier Fourdan's avatar
      xfixes: Add ClientDisconnectMode · 78d0652a
      Olivier Fourdan authored
      
      
      The Xserver itself is capable of terminating itself once all X11 clients
      are gone, yet in a typical full session, there are a number of X11
      clients running continuously (e.g. the Xsettings daemon, IBus, etc.).
      
      Those always-running clients will prevent the Xserver from terminating,
      because the actual number of X11 clients will never drop to 0.
      
      To solve this issue directly at the Xserver level, this add new entries
      to the XFixes extension to let the X11 clients themselves specify the
      disconnect mode they expect.
      
      Typically, those X11 daemon clients would specify the disconnect mode
      XFixesClientDisconnectFlagTerminate to let the Xserver know that they
      should not be accounted for when checking the remaining clients prior
      to terminate.
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Simon Ser's avatarSimon Ser <contact@emersion.fr>
      78d0652a
  13. 02 Jun, 2021 1 commit
  14. 08 Oct, 2020 1 commit
  15. 03 Oct, 2020 1 commit
  16. 04 Jun, 2020 1 commit
  17. 01 Jun, 2020 2 commits
  18. 21 Mar, 2020 1 commit
    • Uli Schlachter's avatar
      Parse a field's "enum=" correctly · 2b3559c1
      Uli Schlachter authored
      
      
      In xv.xml, there is something like this:
      
        <struct name="ImageFormatInfo">
          [...]
          <field type="CARD8" name="byte_order" enum="ImageOrder" />
          <pad bytes="2" />
          <list type="CARD8" name="guid">
            <value>16</value>
          </list>
          [...]
        </struct>
      
      When parsing this, the Field instance for "guid" ended up with .enum ==
      "ImageOrder". This is because the loop that parses complex type did not
      unset a variable across iterations, meaning that the last "enum"
      property "stuck" and was also used for all following fields.
      
      Fix this by simply moving the initialisation of the "enum" variable
      inside of the loop.
      Signed-off-by: Uli Schlachter's avatarUli Schlachter <psychon@znc.in>
      2b3559c1
  19. 22 Feb, 2020 2 commits
  20. 28 Dec, 2019 2 commits
    • Uli Schlachter's avatar
      Allow access to the original type in the XML · e79f6b01
      Uli Schlachter authored
      
      
      xcbgen 'helpfully' transforms things to C types already so that libxcb
      does not have to do so. Thus, even though the XML says that a field has
      type CARD8, xcbgen will claim uint8_t. This might be a bit weird, but is
      so far totally fine.
      
      However, the type mapping that xcbgen uses is not injective. All of
      CARD8, BYTE and BOOL get turned into uint8_t and the original type is
      lost.
      
      This is totally fine for libxcb, but programming languages other than C
      do have built in boolean types. My personal problem is with Rust, where
      providing a boolean for an integer argument causes a compiler error.
      This results in (relatively) ugly "0 / 1" instead of "false / true".
      
      This commit adds a new xml_type member to SimpleType. This type contains
      the original string that appeared in the XML file.
      
      Since libxcb creates instances of SimpleType itself and to avoid
      breaking the API, the new argument to SimpleType.__init__ defaults to
      None.
      Signed-off-by: Uli Schlachter's avatarUli Schlachter <psychon@znc.in>
      e79f6b01
    • Uli Schlachter's avatar
      Fix size computation of imported lists · 3cc42f6d
      Uli Schlachter authored
      
      
      XFixes contains a CreateRegion request:
      
         <request name="CreateRegion" opcode="5">
           <field type="REGION"    name="region" />
           <list  type="RECTANGLE" name="rectangles" />
         </request>
      
      This request contains a list of type RECTANGLE. This struct comes from
      xproto and is thus not contained in xfixes itself.
      
      Normal "Struct"s have their resolve() method called early, because they
      appear in the module itself. However, in the CreateRegion case, this
      struct is imported and thus does not get resolved. Instead, ListType's
      resolve() method calls self.member.resolve(module). Thus, only at this
      point is the struct resolved.
      
      Why is this important? Struct.resolve() is the same as
      ComplexType.resolve() and this function does self.calc_size() at the
      end. Thus, only after the struct was resolved is its size known. Before
      that, the size is just set to 0 (this happens in ComplexType.__init__).
      
      However, ListType.__init__ already computes its size member based on its
      member. At this point, this is still 0 so the list ends up believing its
      size to be zero.
      
      Fix this by recomputing self.size in ListType.resolve().
      Signed-off-by: Uli Schlachter's avatarUli Schlachter <psychon@znc.in>
      3cc42f6d
  21. 02 Nov, 2019 1 commit
  22. 27 Apr, 2019 1 commit
    • Daniel Stone's avatar
      pkg-config: Add sysroot prefix · bd7a481a
      Daniel Stone authored and Jon Turney's avatar Jon Turney committed
      
      
      xcb-proto's pkg-config file exports static file paths for where to find
      its Python files and the XML definitions.
      
      When used to discover cflags, library paths, etc, pkg-config will
      prepend ${PKG_CONFIG_SYSROOT_DIR}, if any, to those paths. This makes
      the use of a sysroot prefix transparent to users. However, since it
      doesn't know about paths in custom variables, it cannot automatically
      prefix this.
      
      Adding ${pc_sysrootdir} to these absolute paths makes the behaviour
      match, and XCB builds work out of the box in a sysroot.
      Signed-off-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      Reviewed-by: Emma Anholt's avatarEric Anholt <eric@anholt.net>
      bd7a481a
  23. 17 Feb, 2019 1 commit
  24. 14 Mar, 2018 1 commit
  25. 28 Feb, 2018 3 commits
    • Daniel Stone's avatar
      Release xcb-proto 1.13 · 94228cde
      Daniel Stone authored
      
      
      This release adds support for variable-sized lists of FDs (e.g. sized
      by a field in the request/event), as well as several other cleanups and
      fixes in the core code.
      
      DRI3 has been bumped to v1.2, using the new support to support
      multi-planar buffers and DRM modifiers.
      
      Present has also been bumped to v1.2, adding a new token for the server
      to indicate to the client that it should reallocate its buffers.
      
      RandR has been updated to 1.6, adding support for DRM leases to allow
      clients to directly control outputs.
      Signed-off-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      94228cde
    • Louis-Francis Ratté-Boulianne's avatar
      present: Add PresentModeSuboptimalCopy flag · 554c09ff
      Louis-Francis Ratté-Boulianne authored and Daniel Stone's avatar Daniel Stone committed
      
      
      This flag (returned with PresentCompleteNotify event) indicates
      that the window could have been flipped instead of copied if
      the buffer format/modifier was different. Clients must indicate
      that they support the flag by adding option PresentOptionSuboptimal
      when calling PresentPixmap.
      
      v2: Add PresentOptionSuboptimal
      Signed-off-by: Louis-Francis Ratté-Boulianne's avatarLouis-Francis Ratté-Boulianne <lfrb@collabora.com>
      554c09ff
    • Louis-Francis Ratté-Boulianne's avatar
      DRI3: Add multi-planar and modifier support · 4bc3f832
      Louis-Francis Ratté-Boulianne authored and Daniel Stone's avatar Daniel Stone committed
      
      
      Bumping to version 1.2, add support for:
        - querying formats and modifiers supported by the server
        - creating (and receiving) multi-planar buffers
        - creating (and receiving) buffers with modifiers
      
      v2: Fix alignment
      v3: Bump to version 1.2 rather than 1.1. The old dri3proto had a '1.1'
          release for non-functional changes, so we avoid that version and
          skip directly to 1.2.
      Signed-off-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      Signed-off-by: Louis-Francis Ratté-Boulianne's avatarLouis-Francis Ratté-Boulianne <lfrb@collabora.com>
      4bc3f832
  26. 15 Dec, 2017 1 commit
  27. 05 Jun, 2017 1 commit
  28. 13 May, 2017 1 commit
  29. 11 Mar, 2017 1 commit
    • Christian Linhart's avatar
      SendExtensionEvent uses eventstruct · 97fbba25
      Christian Linhart authored
      
      
      Use the eventstruct element to define the SendExtensionEvent request
      instead of using a byte-array.
      
      This has the advantage that the structure of the data to be sent
      is now defined in the xml definition.
      This can be used by generators to make sending events safer.
      Such as avoiding type-casts in C.
      
      It can also be useful for protocol analyzers and tools like that
      because the structure of the sent events is now defined in the xml-definition.
      Tested-by: Christian Linhart's avatarChristian Linhart <chris@demorecorder.com>
      Signed-off-by: Christian Linhart's avatarChristian Linhart <chris@demorecorder.com>
      97fbba25