Commit Graph

16 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
Alexander Orzechowski 1b0694b794 treewide: Migrate from sizeof(struct) to sizeof(*pointer) where practical 2023-10-03 01:51:07 -04:00
Kirill Primak b7e2a2584e foreign-toplevel-management: fix indentation 2022-10-01 19:57:32 +00:00
Alexander Orzechowski ef4baea0e2 Use wl_signal_emit_mutable 2022-08-18 07:16:16 -04:00
Isaac Freund 1bd0ea3a80
foreign-toplevel: send enter if needed on output bind
Currently the output enter event is never sent if the client has not
yet bound the output, which happens every time the compositor creates a
new output.

To fix this, listen for the output bind event and inform clients as
if needed.
2022-01-17 19:11:08 +01:00
Kirill Primak 617eb4fb93 surface: deprecate wlr_surface.h 2022-01-13 10:06:41 +00:00
Isaac Freund 5d24f6e098 toplevel-management: avoid redundant state events
Check if there would be a state change on setting maximized, minimized,
activated, or fullscreen before sending a state event.
2021-01-05 12:22:20 +01:00
Isaac Freund 8b90d5e17f toplevel-management: handle strdup failure
Sending a NULL string to a client would be a violation of the protocol.
2021-01-05 12:22:20 +01:00
Isaac Freund abcab0331f toplevel-management: ignore inert seats 2021-01-05 12:22:20 +01:00
Daniel Kondor b4ed8b3d74 foreign toplevel: send parent event only to clients that support it 2020-10-20 09:12:07 +02:00
Daniel Kondor 36395e5b1c
foreign-toplevel-management: report parent toplevel
Based on the wlr-protocols PR:
https://github.com/swaywm/wlr-protocols/pull/52
2020-10-18 17:14:35 +02:00
Simon Ser 5cde35923c Simplify globals implementation by removing destructors
Some globals are static and it doesn't make sense to destroy them before
the wl_display. For instance, wl_compositor should be created before the
display is started and shouldn't be destroyed.

For these globals, we can simplify the code by removing the destructor
and stop keeping track of wl_resources (these will be destroyed with the
wl_display by libwayland).
2019-11-25 09:01:46 -05:00
Simon Ser 16e5e9541b Add -Wmissing-prototypes
This requires functions without a prototype definition to be static.
This allows to detect dead code, export less symbols and put shared
functions in headers.
2019-11-20 02:05:03 +00:00
Ilia Bozhinov 4e6c17a7c9 foreign-toplevel: support fullscreen state and request 2019-04-29 00:00:53 +03:00
emersion a4eb90315e
Fix indentation in various files 2019-01-21 17:56:19 +01:00
Ilia Bozhinov 5b1b9657bf types: implement wlr_foreign_toplevel_management_v1 2018-12-08 14:09:30 +01:00