summaryrefslogtreecommitdiffstats
path: root/cursor
Commit message (Collapse)AuthorAgeFilesLines
* cursor: add one more directory to XCURSORPATHAlexander Dunaev2021-04-271-8/+42
| | | | | | | | | | | | | | | | The user may install cursor themes manually, and the desktop environment may provide a special directory for storing them. For instance, GTK puts those themes into ~/.local/share/icons, and many Linux distributions suggest using that directory for user-specific themes. However, users of libwayland-cursor cannot load these themes using the API provided by the library because the latter does not look into that directory. This patch adds ~/.local/share/icons to the search path, so user-specific themes can be loaded through the API provided by libwayland-cursor. Signed-off-by: Alexander Dunaev <adunaev@igalia.com> Reviewed-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> Reviewed-by: Simon Ser <contact@emersion.fr>
* build: drop autotoolsSimon Ser2021-03-052-18/+0
| | | | | | Meson now replaces autotools. Signed-off-by: Simon Ser <contact@emersion.fr>
* cursor: fix typo "insufficent"Maxime Roussin-Bélanger2020-12-171-1/+1
|
* cursor/convert_font.c: malloc cannot guarantee that the memory allocated is ↵ganjing2020-10-291-0/+5
| | | | always successful
* Fix undefined behaviorValentin2020-09-041-4/+5
| | | | | | | | Without the casts the bytes accesses get converted to int. but int is not guaranteed to be 4 bytes large. Even when it is 4 bytes large `bytes[3] << 24` does not fit because int is signed. Signed-off-by: Valentin Kettner <vakevk@gmail.com>
* Use fixed size integer typeValentin2020-09-041-1/+3
| | | | | | | | This type is meant to be 4 bytes large as seen in _XcursorReadUInt which always reads 4 bytes. An unsigned int is often 4 bytes large but this isnt' guaranteed so it is cleaner to use the exact type we want. Signed-off-by: Valentin Kettner <vakevk@gmail.com>
* cursor: Properly document wl_cursor_image and wl_cursorEmmanuel Gil Peyrot2020-06-051-5/+24
| | | | Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
* cursor: Use spaces for alignment in the headerEmmanuel Gil Peyrot2020-06-051-5/+5
| | | | Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
* cursor/os-compatibility: move resizing into a separate functionJan Beich2020-02-233-24/+21
| | | | Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
* cursor: ignore posix_fallocate in shm_pool_resize if not supported by FSJan Beich2020-02-231-4/+8
| | | | Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
* cursor: posix_fallocate may fail with EINVAL if not supportedJan Beich2020-02-231-3/+3
| | | | | | | ZFS on FreeBSD >= 12.0 returns EINVAL, see https://svnweb.freebsd.org/changeset/base/325320 Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
* os: fallback for unsupported posix_fallocateIhor Antonov2020-01-231-3/+8
| | | | | | | | | | | | | | | Some filesystems do not support fallocate and return EOPNOTSUPP. On musl-based distros libwayland-cursor exits abruptly which causes the application to crash. Unlike glibc, musl does not provide a fallback mechanism for handling unsupported fallocate. Instead, musl developers argue that application should handle the case of unsupported system call. This commit allows falback to ftruncate in case when EOPNOTSUPP was recieved. Signed-off-by: Ihor Antonov <ihor@antonovs.family>
* Add Meson buildEmmanuele Bassi2020-01-101-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Meson is a next generation build system, simpler than Autotools and also faster and more portable. Most importantly, it will make integrating ASan easier in CI. The goal is to maintain feature parity of the Meson build with the Autotools build, until such time when we can drop the latter. Add a script which generates the desired Doxygen configuration for our various output formats and executes it using that configuration. This is not something Meson can or should do. Fixes: https://gitlab.freedesktop.org/wayland/wayland/issues/80 [daniels: Changed to bump version, use GitLab issues URL, remove header checks not used in any code, remove pre-pkg-config Expat support, added missing include paths to wayland-egl and cpp-compile-test, added GitLab CI. Bumped version, removed unnecessary pkg-config paths.] [daniels: Properly install into mandir/man3 via some gross paramaterisation, generate real stamp files.] Pekka: - squashed patches - removed MAKEFLAGS from meson CI - remove unused PACKAGE* defines - fix up scanner dependency handling - instead of host_scanner option, build wayland-scanner twice when cross-compiling - changed .pc files to match more closely the autotools versions - reorder doxygen man sources to reduce diff to autotools - fix pkgconfig.generate syntax warnings (new in Meson) - bump meson version to 0.47 for configure_file(copy) and run_command(check) - move doc tool checks into doc/meson.build, needed in more places - make all doc tools mandatory if building docs - check dot and doxygen versions - add build files under doc/publican - reindent to match Weston Meson style Simon: - Remove install arg from configure_file - Don't build wayland-scanner twice during cross-build - Fix naming of the threads dependency - Store tests in dict - Add missing HAVE_* decls for functions - Remove unused cc_native variable - Make doxygen targets a dict - Make dot_gv a dict - Use dicts in man_pages - Make decls use dicts - Make generated_headers use dicts - Align Meson version number with autotool's Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com> Signed-off-by: Simon Ser <contact@emersion.fr>
* cursor: Use memfd_create() when availableEmmanuel Gil Peyrot2019-07-211-15/+41
| | | | | | | | | | | | | | | This (so-far) Linux-only API lets users create file descriptors purely in memory, without any backing file on the filesystem and the race condition which could ensue when unlink()ing it. It also allows seals to be placed on the file, ensuring to every other process that we won’t be allowed to shrink the contents, potentially causing a SIGBUS when they try reading it. This patch is best viewed with the -w option of git log -p. Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> Reviewed-by: Simon Ser <contact@emersion.fr>
* cursor: add forward declaration for struct wl_bufferEmil Velikov2017-12-041-2/+2
| | | | | | | | | | | This makes the header self-contained, since the struct is considered opaque from waylad-cursor POV. As we're here move the wl_shm fwd. declaration alongside the others. Making it easier to read and track. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
* cursor: Fix heap overflows when parsing malicious files.Tobias Stoeckmann2017-11-291-1/+7
| | | | | | | | | | | | | | | | | It is possible to trigger heap overflows due to an integer overflow while parsing images. The integer overflow occurs because the chosen limit 0x10000 for dimensions is too large for 32 bit systems, because each pixel takes 4 bytes. Properly chosen values allow an overflow which in turn will lead to less allocated memory than needed for subsequent reads. See also: https://cgit.freedesktop.org/xorg/lib/libXcursor/commit/?id=4794b5dd34688158fb51a2943032569d3780c4b8 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=103961 Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> [Pekka: add link to the corresponding libXcursor commit] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* cursor: Remove "weston" from anonymous shm filenamesDerek Foreman2016-11-211-1/+1
| | | | | | | | | | | This mildly confused me during some debugging, so I guess it wouldn't hurt to make the filename more indicative of where it was actually created. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* (multiple): Include stdint.hYong Bakos2016-07-252-0/+3
| | | | | | | | | | Some headers and source files have been using types such as uint32_t without explicitly including stdint.h. Explicitly include stdint.h where appropriate. Signed-off-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
* cursor: Update printed license from MIT "X11" to MIT "Expat"Bryce Harrington2015-06-221-22/+30
| | | | | | | | | The code generates a cursor-data.h file, with licensing information. Change this from the MIT "X11" license to MIT "Expat" license for consistency with the rest of Wayland. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* xcursor: Change keithp licensed code from X11 to Expat licenseBryce Harrington2015-06-122-32/+38
| | | | | | | | | | | The license text for this file mentions Keith Packard specifically, however it is otherwise identical to all the other MIT X11 licensed code in Wayland, and so can be changed to the substantially identical MIT Expat license. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Keith Packard <keithp@keithp.com>
* cursor-data.h: Change SuSE licensed code from X11 to ExpatBryce Harrington2015-06-121-15/+19
| | | | | | | | | | The license text for this file mentions SuSE specifically, however it is otherwise identical to all the other MIT X11 licensed code in Wayland, and so can be changed to the substantially identical MIT Expat license. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Keith Packard <keithp@keithp.com>
* cursor: Update boilerplate from MIT X11 license to MIT Expat licenseBryce Harrington2015-06-125-80/+95
| | | | | Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* remove trailing whitespacesMichael Vetter2015-05-151-502/+502
| | | | | Remove trailing whitespaces because they are not needed and jumping to the end of al ine should do just that and not jump to the whitespace.
* cursor: free the array from which images are linkedEmmanuel Gil Peyrot2015-03-181-0/+1
|
* cursor: add wl_cursor_frame_and_durationDerek Foreman2015-03-052-3/+46
| | | | | | | | It's useful to know how long the current cursor frame should be displayed so we can wait that long to change it. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* Add error handling for wl_cursorsHardening2014-04-011-7/+13
| | | | | | This patch adds some error management in wayland cursors Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
* build: Move cursor Makefile.am into toplevel Makefile.amKristian Høgsberg2014-03-061-21/+0
|
* xcursor: don't proceed if XcursorImageCreate failedU. Artie Eoff2014-01-151-0/+2
| | | | Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
* cursor: check for memory allocation errorsU. Artie Eoff2014-01-151-1/+13
| | | | Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
* cursor: free theme->name tooU. Artie Eoff2014-01-151-0/+1
| | | | Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
* cursor: handle running out of buffer spacePekka Paalanen2013-12-021-16/+51
| | | | | | | | | | | | | | | | | | | | | If posix_fallocate is available, use it to detect when we are running out of buffer space. Propagate the failure properly through the various functions, stopping loading cursors but keeping the cursors that were already successfully loaded. This may result in an animated cursor not having all of its images, or a cursor theme not having all of its cursors. When that happens, the failure is NOT communicated to the application. Instead, the application will get NULL from wl_cursor_theme_get_cursor() for a cursor that was not loaded successfully. If an animated cursor is missing only some images, the animation is truncated but the cursor is still available. This patch relies on the commit "os: use posix_fallocate in creating sharable buffers" for defining HAVE_POSIX_FALLOCATE. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* os: use posix_fallocate in creating sharable buffersPekka Paalanen2013-12-021-1/+18
| | | | | | | | | | | | | | | | If posix_fallocate is available, use it instead of ftruncate. Unlike ftruncate, when posix_fallocate succeeds, it guarantees that you cannot run out of disk space, when later writing to the mmap()'ed file. With posix_fallocate, if os_create_anonymous_file() succeeds, the program cannot get a SIGBUS later from accessing this file via mmap. If there is insufficient disk space, the function fails and errno is set to ENOSPC. This is useful on systems, that limit the available buffer space by having XDG_RUNTIME_DIR on a small tmpfs. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* wayland: Be consistent about #include-guard namesKristian Høgsberg2013-10-211-2/+2
| | | | | | | We had a mix of inconsistent names, some of which were non-conformant. Standardize on all-uppercase-and-underscore naming convention. https://bugs.freedesktop.org/show_bug.cgi?id=70679
* pkgconfig: Use configure provided directoriesQuentin Glidic2012-11-271-4/+4
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=57630
* Move ARRAY_LENGTH out of public headersKristian Høgsberg2012-10-191-0/+2
| | | | | | | | Exporting unprefixed symbols is a pretty bad idea so don't do that. Instea of redefining it WL_ARRAY_LENGTH, we just move the define to our private header. The scanner generates code that uses ARRAY_LENGTH, but we can just make it count the number elements and emit an integer constant instead.
* Ensure cursor_data.c is included in distribution tarballsMatt Roper2012-10-094-2/+3
| | | | Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
* xcursor: Fix allocation based on string lengthRob Bradford2012-10-091-1/+1
| | | | | | | | strlen() doesn't include the terminating NUL. Therefore when allocating a block of memory to hold something equivalent to the length of the string we must increment to take the NUL byte into consideration. Signed-off-by: Rob Bradford <rob@linux.intel.com>
* cursor: add cursor.pcf and extraction programPhilipp Brüschweiler2012-09-102-0/+531
|
* cursor: Add a default cursor themePhilipp Brüschweiler2012-09-102-1/+618
| | | | | | | This theme is loaded when the specified cursor theme can not be found. These cursors are extracted from the xorg sources and transformed into raw ARGB data by a small helper program (commited separately).
* Add support for X cursor themes.Christopher Michael2012-08-131-1/+1
| | | | | | | | | This patch adds a few more directories to search for xcursor themes. Along with the weston patch, this adds the ability to configure weston to use an X11 cursor theme. Previously, wayland cursor would just look in the icons and pixmaps directories for cursor images to load. This adds the ability to also search in the x cursors directory.
* Don't skip the first directory entry when reading cursors.Dima Ryazanov2012-07-261-1/+0
| | | | I end up missing the "bottom_right_corner" cursor.
* cursor: fix fd leak and a segfaultPekka Paalanen2012-07-101-0/+6
| | | | | | | | | - don't leak fd in shm_pool_destroy() - return NULL from wl_cursor_theme_load() if pool fails Tha last one fixes a segfault, when shm_pool_create() has failed. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
* cursor: use os_create_anonymous_file()Pekka Paalanen2012-07-104-6/+164
| | | | | | | Copy the implementation of os_create_anonymous_file() here from weston, so we can use it instead of hardcoding a path to /tmp. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
* wayland-cursor: Add error handling for shm_pool_create()Martin Olsson2012-07-091-9/+11
|
* wayland-cursor: Plug leak of filename on load_all_cursors_from_dir()Ander Conselvan de Oliveira2012-06-191-1/+4
|
* Xcursor: Don't ignore unknown file typesDaniel Stone2012-06-181-1/+2
| | | | | | | | | XFS doesn't return the file type with opendir(), and instead only returns it when you stat() the file itself. c66f2602 introduced a check to ensure that only files and symlinks were loaded, while not checking for DT_UNKNOWN. Properly handle DT_UNKNOWN by just proceeding anyway. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
* cursor: Add function for calculating current frame in cursor animationAnder Conselvan de Oliveira2012-06-152-7/+45
| | | | | | Given a pointer to struct wl_cursor and an elapsed time in ms., wl_cursor_frame() will return the index of the cursor image the should be displayed.
* wayland-cursor: add an option that changes the cursor theme directoryAnder Conselvan de Oliveira2012-06-081-1/+5
| | | | | | Some distros (e.g. gentoo) install cursor themes in non-standard directories. Add option --with-icondir to configure.sh that sets the directory in which to look for cursors.
* cursor: Fix warning with objdir != srcdir buildDaniel Stone2012-05-311-1/+1
| | | | | | | | Make sure we find the right include paths. krh: Edited to use $(top_builddir) Signed-off-by: Daniel Stone <daniel@fooishbar.org>
* build: add uninstalled pkg-config filesPekka Paalanen2012-05-291-0/+8
| | | | | | | Required for building apps against wayland libraries that have not been installed. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>