Commit Graph

20 Commits

Author SHA1 Message Date
Simon Zeni
8221c487ed xcursor/wlr_xcursor: properly clean xcursor in case of realloc failure in load_callback 2024-04-18 16:47:07 +02:00
Simon Ser
842093bb84 Define _POSIX_C_SOURCE globally
Stop trying to maintain a per-file _POSIX_C_SOURCE. Instead,
require POSIX.1-2008 globally. A lot of core source files depend
on that already.

Some care must be taken on a few select files where we need a bit
more than POSIX. Some files need XSI extensions (_XOPEN_SOURCE) and
some files need BSD extensions (_DEFAULT_SOURCE). In both cases,
these feature test macros imply _POSIX_C_SOURCE. Make sure to not
define both these macros and _POSIX_C_SOURCE explicitly to avoid
POSIX requirement conflicts (e.g. _POSIX_C_SOURCE says POSIX.1-2001
but _XOPEN_SOURCE says POSIX.1-2008).

Additionally, there is one special case in render/vulkan/vulkan.c.
That file needs major()/minor(), and these are system-specific.
On FreeBSD, _POSIX_C_SOURCE hides system-specific symbols so we need
to make sure it's not defined for this file. On Linux, we can
explicitly include <sys/sysmacros.h> and ensure that apart from
symbols defined there the file only uses POSIX toys.
2024-02-15 15:41:12 +01:00
Simon Ser
d6998d36ed xcursor: fix duplicate cursor check check in load_callback()
wlr_xcursor_theme_get_cursor() now does some fallback logic. We
don't want that for checking whether a cursor has already been
loaded.

Fixes: dbedcdb418 ("xcursor: add fallbacks for legacy names")
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3783
2023-12-12 19:45:17 +00:00
Kirill Primak
c6b498528c xcursor: don't store NULL xcursors 2023-11-19 15:33:39 +03:00
Simon Ser
dbedcdb418 xcursor: add fallbacks for legacy names
Some XCursor themes still use the legacy names instead of the newer
cursor naming spec [1]. Fall back to the legacy name if the standard
one could not be found.

[1]: https://www.freedesktop.org/wiki/Specifications/cursor-spec/

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3746
2023-11-01 13:13:22 +00:00
Simon Ser
25d9055281 xcursor: sync with libwayland
xcursor.c was copied over from libwayland-cursor. A lot of
cosmetic imporvements have been merged upstream. Copy-paste the
new version.
2023-04-18 14:54:25 +00:00
Simon Ser
9affcaa93c xcursor: adjust style, use calloc()
Adjust the code style for wlroots, and use calloc() for structs.
2023-04-11 20:05:27 +02:00
Simon Ser
1a5530d14d xcursor: quiet debug log
Stop listing all available cursors each time a cursor theme is
loaded. They can be obtained from the CLI instead, e.g.

    ls /usr/share/icons/Adwaita/cursors
2021-04-26 20:11:05 +02:00
Manuel Stoeckl
b6dea80907 xcursor: make cursor data and metadata const 2021-02-05 10:04:20 +01:00
Antonin Décimo
d9bb792794 Fix incorrect format parameters 2020-07-27 10:49:19 +02:00
Antonin Décimo
820800a5ab xcursor: avoid leak and loss of all cursors if cursors realloc fails 2019-08-12 09:37:21 +09:00
emersion
2d0c5ec78e
Use _POSIX_C_SOURCE, use shm_open 2018-11-06 08:29:23 +01:00
emersion
7cbef15206
util: add wlr_ prefix to log symbols 2018-07-09 22:49:54 +01:00
emersion
625a7a48dc
Don't use the wlr_ prefix for static functions 2018-04-25 23:51:00 +01:00
Drew DeVault
1d9be89e2d
Revert "ELF Visibility" 2018-02-19 18:01:27 -05:00
Scott Anderson
86269052eb Explicitly export EFL symbols 2018-02-19 14:26:40 +13:00
emersion
c2e1474010
Reformat all #include directives 2018-02-12 21:29:23 +01:00
emersion
bde255933e
output: add wlr_output::damage, fixes #572 2018-01-18 19:47:21 +01:00
Tony Crisci
4c60072be5 move get_resize_name to xcursor 2017-12-08 06:08:06 -05:00
Tony Crisci
f334dcaf40 rename wlr_cursor.c to wlr_xcursor.c 2017-08-18 19:52:55 -04:00