Commit Graph

6 Commits

Author SHA1 Message Date
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
Paul Cercueil 220df2aa0f
Add more POSIX compliance macros to fix uClibc support
- Add POSIX 1993.09 compliance macro in source files that use
  "struct timespec";
- Add POSIX 2001.12 compliance macro in source files that use
  "struct sigaction" and the SA_SIGINFO macro, or the fchmod()
  function;
- Add POSIX 2008.09 compliance macro in source files that use the
  getline() function.

These compliance macros are enough for wlroots to compile with the
git-master version of uClibc-ng.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
2024-02-12 17:41:45 +01:00
Kirill Primak af4181f388 drag: use unified map logic 2023-06-02 17:26:18 +00:00
Alexander Orzechowski 323f0b94db wlr_scene: Cleanup header includes
We don't need to pull wlr_compositor.
2023-02-20 16:53:59 -05:00
Simon Ser 258bf9be1e compositor: drop wlr_surface.{sx,sy}
The concept of a persistent accumulated surface offset is wrong
from a protocol point-of-view. wl_surface.offset is tied to a
commit, its interpretation depends on the surface role.

For example, with the following sequence:

    wl_surface@1.offset(1, 1)
    wl_surface@1.commit()
    wl_pointer@2.set_cursor(wl_surface@1, 42, 42)

The final cursor hotspot is (42, 42): the commit which happened
before the set_cursor request has no impact on the hotspot
computation.

The wlr_output_cursor logic already uses wlr_surface.current.{dx,dy}.
wlr_scene's drag icon doesn't, update it accordingly.
2022-11-15 13:41:09 +00:00
Alexander Orzechowski c8a5dfcc87 wlr_scene: Add drag icon helper 2022-11-14 15:44:43 +00:00