1. 26 Jul, 2016 1 commit
  2. 07 Jun, 2016 1 commit
  3. 11 May, 2016 1 commit
    • Yong Bakos's avatar
      doc: Formalize file comment in wayland-client.h, wayland-server.h · e5b12aa8
      Yong Bakos authored
      Publican was generating a subtle error during a build:
      Error: no ID for constraint linkend: Server-wayland-server-core_8h.
      This was caused by doxygen applying the doc comment at the top of
      wayland-server.h as the documentation for struct wl_object. As such, the
      generated documentation for wl_object was also very incorrect.
      Make the file doc comments in wayland-client.h and wayland-server.h real
      doxygen file doc comments with the \file command, add a \brief, make the
      inclusion warning a \warning, correct the language of the comment in
      wayland-server.h, and remove one unnecessary line break.
      This squelches the publican error, removes the bad wl_object documentation,
      and makes the comment appear in the generated html documentation.
      References: d74a9c07Signed-off-by: default avatarYong Bakos <ybakos@humanoriented.com>
      Reviewed-by: default avatarBryce Harrington <bryce@osg.samsung.com>
  4. 12 Jun, 2015 1 commit
  5. 30 Apr, 2015 1 commit
    • Giulio Camuffo's avatar
      introduce new headers wayland-client-core.h and wayland-server-core.h · d74a9c07
      Giulio Camuffo authored
      wayland-client.h and wayland-server.h include the protocol headers generated
      at build time. This means that a libwayland user cannot generate and use
      protocol code created from a wayland.xml newer than the installed libwayland,
      because it is not possible to only include the API header.
      Another use case is language bindings, which would generate their own protocol
      code and which only need to use the library ABI, not the generated C code.
      This commit adds wayland-client-core.h and wayland-server-core.h which do not
      include the protocol headers or any deprecated code.
      Reviewed-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
      Reviewed-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
  6. 25 Nov, 2014 1 commit
  7. 05 Aug, 2014 1 commit
  8. 25 Jul, 2014 1 commit
  9. 06 Feb, 2014 1 commit
    • Neil Roberts's avatar
      Don't deref the sample pointer in the wl_container_of macro · a18e3441
      Neil Roberts authored
      The previous implementation of the wl_container_of macro was
      dereferencing the sample pointer in order to get an address of the
      member to calculate the offset. Ideally this shouldn't cause any
      problems because the dereference doesn't actually cause the address to
      be read from so it shouldn't matter if the pointer is uninitialised.
      However this is probably technically invalid and could cause undefined
      behavior. Clang appears to take advantage of this undefined behavior
      and doesn't bother doing the subtraction. It also gives a warning when
      it does this.
      The documentation for wl_container_of implies that it should only be
      given an initialised pointer and if that is done then there is no
      problem with clang. However this is quite easy to forget and doesn't
      cause any problems or warnings with gcc so it's quite easy to
      accidentally break clang.
      To fix the problem this changes the macro to use pointer -
      offsetof(__typeof__(sample), member) so that it doesn't need to deref
      the sample pointer. This does however require that the __typeof__
      operator is supported by the compiler. In practice we probably only
      care about gcc and clang and both of these happily support the
      The previous implementation was also using __typeof__ but it had a
      fallback path avoiding it when the operator isn't available. The
      fallback effectively has undefined behaviour and it is targetting
      unknown compilers so it is probably not a good idea to leave it in.
      Instead, this patch just removes it. If someone finds a compiler that
      doesn't have __typeof__ but does work with the old implementation then
      maybe they could add it back in as a special case.
      This patch removes the initialisation anywhere where the sample
      pointer was being unitialised before using wl_container_of. The
      documentation for the macro has also been updated to specify that this
      is OK.
  10. 15 Jan, 2014 1 commit
  11. 14 Nov, 2013 1 commit
    • Neil Roberts's avatar
      server: Add API to protect access to an SHM buffer · cf4f5995
      Neil Roberts authored
      Linux will let you mmap a region of a file that is larger than the
      size of the file. If you then try to read from that region the process
      will get a SIGBUS signal. Currently the clients can use this to crash
      a compositor because it can create a pool and lie about the size of
      the file which will cause the compositor to try and read past the end
      of it. The compositor can't simply check the size of the file to
      verify that it is big enough because then there is a race condition
      where the client may truncate the file after the check is performed.
      This patch adds the following two public functions in the server API
      which can be used wrap access to an SHM buffer:
      void wl_shm_buffer_begin_access(struct wl_shm_buffer *buffer);
      void wl_shm_buffer_end_access(struct wl_shm_buffer *buffer);
      The first time wl_shm_buffer_begin_access is called a signal handler
      for SIGBUS will be installed. If the signal is caught then the buffer
      for the current pool is remapped to an anonymous private buffer at the
      same address which allows the compositor to continue without crashing.
      The end_access function will then post an error to the buffer
      The current pool is stored as part of some thread-local storage so
      that multiple threads can safely independently access separate
      Eventually we may want to add some more API so that compositors can
      hook into the signal handler or replace it entirely if they also want
      to do some SIGBUS handling.
  12. 21 Oct, 2013 1 commit
  13. 21 Sep, 2013 1 commit
    • Aaron Faanes's avatar
      doc: Slight tweaks to wl_listener · 5a925532
      Aaron Faanes authored
      Prefer \comment over // in code blocks for consistency's sake and keep
      variable definitions separated by a line from the rest of the body.
  14. 17 Sep, 2013 3 commits
  15. 11 Sep, 2013 2 commits
  16. 19 Aug, 2013 1 commit
    • Jason Ekstrand's avatar
      Add support for server-side language bindings · c4409090
      Jason Ekstrand authored
      This commit adds support for server-side languages bindings.  This is done
      in two ways:
      1. Adding a wl_resource_set_dispatcher function that corresponds to
      wl_resource_set_interface.  The only difference between the two functions
      is that the new version takes a dispatcher along with the implementation,
      data, and destructor.  This allows for runtime calling of native language
      functions for callbacks instead of having to generate function pointers.
      2. Adding versions of wl_resource_post_event and wl_resource_queue_event
      that take an array of wl_argument instead of a variable argument list.
      This allows for easier run-time argument conversion and removes the need
      for libffi-based calling of variadic functions.
      Signed-off-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
  17. 12 Aug, 2013 1 commit
  18. 06 Aug, 2013 1 commit
  19. 09 Jul, 2013 1 commit
    • Kristian Høgsberg's avatar
      wayland-server: Add wl_global_create/destroy() · 4cffa0fd
      Kristian Høgsberg authored
      This patch introduces wl_global_create() and wl_global_destroy() as
      replacements for wl_display_add_global() and wl_display_remove_global().
      The add/remove_global API did not allow a compositor to indicate
      the implemented version of a global, it just took the version from
      the interface meta data.  The problem is that the meta data
      (which lives in libwayland-server.so) can get out of sync with a
      compositor implementation.  The compositor will then advertise a
      higher version of a global than what it actually implements.
      The new API lets a compositor pass in a version when it registers
      a global, which solves the problem.  The add/remove API is deprecated
      with this patch and will be removed.
  20. 02 Jul, 2013 4 commits
    • Kristian Høgsberg's avatar
      wayland-server: Remove error event posting from wl_resource_create · c82a52a4
      Kristian Høgsberg authored
      The wl_client_add/new_object() functions sends out an NO_MEMORY error if
      the allocation fails.  This was convenient in a couple of places where
      that was all the error handling that was needed.  Unfortunately that
      looks like out-of-memory isn't handled at the call site and set a bad
      precedent for not cleaning up properly or not handling at all.
      As we're introducing wl_resource_create() as a replacement for those two
      functions, let's remove the automatic error event posting and require
      the caller to do that if necessary.
      This commit also introduces a new helper, wl_client_post_no_memory() to
      make it possible to send NO_MEMORY events from bind where we don't have
      a wl_resource.
    • Kristian Høgsberg's avatar
    • Jason Ekstrand's avatar
      Add wl_resource_create() and a version field to wl_resource · 4917a967
      Jason Ekstrand authored
      A new function, wl_resource_create(), lets the compositor create a
      wl_resource for a given version of the interface.  Passing 0 for the
      object ID will allocate a new ID. The implementation, user data and
      destructor can be set with wl_resource_set_implementation().
      These two functions deprecates wl_client_add/new_object and the
      main difference and motivation is the ability to provide a version number
      for the resource.  This lets the compositor track which version of the
      interface a client has created and we'll use that to verify incoming requests.
      Signed-off-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
    • Kristian Høgsberg's avatar
      server: Make wl_object and wl_resource opaque structs · d94a8722
      Kristian Høgsberg authored
      With the work to add wl_resource accessors and port weston to use them,
      we're ready to make wl_resource and wl_object opaque structs.  We keep
      wl_buffer in the header for EGL stacks to use, but don't expose it by
      default.  In time we'll remove it completely, but for now it provides a
      transition paths for code that still uses wl_buffer.
      Reviewed-by: Jason Ekstrand<jason@jlekstrand.net>
  21. 21 Jun, 2013 3 commits
  22. 14 Jun, 2013 1 commit
  23. 07 Jun, 2013 1 commit
  24. 05 Jun, 2013 1 commit
  25. 08 May, 2013 1 commit
  26. 07 May, 2013 1 commit
    • Kristian Høgsberg's avatar
      Remove input structs · e920572e
      Kristian Høgsberg authored
      Looking at the functionality in the server library, it's clear (in
      hindsight) that there are two different "things" in there: 1) The IPC
      API, that is, everything that concerns wl_display, wl_client,
      wl_resource and 2) and half-hearted attempt at sharing input code and
      focus logic that leaves a lot of problematic structs in the API
      surface, only to share less than 1000 lines of code.
      We can just move those input structs and helper functions into weston
      and cut libwayland-server down to just the core server side IPC API.
      In the short term, compositors can copy those structs and functions
      into their source, but longer term, they're probably better off
      reimplementing those objects and logic their native framework
      (QObject, GObject etc).
  27. 03 Apr, 2013 1 commit
  28. 02 Apr, 2013 1 commit
  29. 19 Mar, 2013 1 commit
    • Jason Ekstrand's avatar
      Add wl_resource_init and use it in libwayland implementations of data sharing and SHM · bedc3432
      Jason Ekstrand authored
      This commit adds a wl_resource_init function for initializing wl_resource
      structures similar to wl_client_add_object.
      From this commit forward, wl_resource structures should not be initialized
      manually, but should use wl_resource_init.  In the event of a change to the
      wl_resource structure, this allows us to protect against regressions by filling
      in added fields with reasonable defaults.  In this way, while changing
      wl_object or wl_resource still constitutes an ABI break, compositors following
      this rule will only need to be recompiled in order to properly link against the
      new version.
      Signed-off-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
  30. 15 Jan, 2013 1 commit
  31. 11 Jan, 2013 1 commit
  32. 15 Oct, 2012 1 commit
    • Matt Roper's avatar
      wayland-server: Add touch grab support · 4ce294d6
      Matt Roper authored
      Touch grabs allow the compositor to be placed into a mode where touch events
      temporarily bypass their default behavior and perform other operations.
      Wayland already supports keyboard and pointer grabs, but was lacking
      corresponding touch support.  The default touch grab handlers here contain the
      client event delivery code that was previously called directly in weston.
      Signed-off-by: Matt Roper's avatarMatt Roper <matthew.d.roper@intel.com>