Commit Graph

18 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
Alexander Orzechowski ef4baea0e2 Use wl_signal_emit_mutable 2022-08-18 07:16:16 -04:00
Simon Ser ca45f4490c Remove all wayland-server.h includes
The documentation for wayland-server.h says:

> Use of this header file is discouraged. Prefer including
> wayland-server-core.h instead, which does not include the server protocol
> header and as such only defines the library PI, excluding the deprecated API
> below.

Replacing wayland-server.h with wayland-server-core.h allows us to drop the
WL_HIDE_DEPRECATED declaration.
2019-07-27 15:49:32 -04:00
Simon Ser 4207f05030 data-device: ignore accept for selection offers
It doesn't make sense for clients to send "accept" requests to offers that
aren't drag-and-drop. I discussed with Daniel Stone to make it a protocol
error [1] but too many clients send it (e.g. GTK+). Let's just log it for now.

[1]: https://gitlab.freedesktop.org/wayland/wayland/merge_requests/11#note_149710
2019-04-19 13:24:41 -06:00
emersion d425206719 data-device: check if there's a source before sending dnd_finish
This could cause a segfault in data_offer_destroy if the offer has version < 3.
2019-02-24 19:40:10 -05:00
emersion d6de640440
data-device: unbreak wl_data_source.cancel during drag-and-drop 2019-02-20 18:42:34 +01:00
emersion 7d367a9e21
data-offer: send WL_DATA_OFFER_ERROR_INVALID_FINISH 2019-02-20 18:42:34 +01:00
emersion a1f9d7ad9e
data-device: keep track of wlr_data_offer in wlr_seat lists 2019-01-24 12:18:41 +01:00
emersion 909b3b16f3
data-device: add wlr_data_offer.type 2019-01-24 12:18:40 +01:00
emersion 84f278eca1
data-device: remove data_source_send_offer 2019-01-24 12:12:55 +01:00
emersion 4423f88fac
data-device: never cancel the source when offer is destroyed
The source could be used in another offer.
2018-11-26 12:35:49 +01:00
emersion 5d26da9d15
data-device: allow multiple devices for the same seat
This commit makes it possible for a single client to have multiple data devices
for the same seat. This fixes issues with Firefox.

This mainly removes wlr_data_source.offer. We make sure we create one data
offer per device. We now make the offer inert when the source is destroyed.

Fixes the second half of https://github.com/swaywm/wlroots/issues/1041
2018-11-26 12:35:48 +01:00
Julio Galvan a31fa678e5
Fix compilation error on musl
_XOPEN_SOURCE is needed for the strings.h ffs function on the musl libc implementation
2018-11-09 04:27:06 +00:00
emersion 2d0c5ec78e
Use _POSIX_C_SOURCE, use shm_open 2018-11-06 08:29:23 +01:00
emersion f44003f04b data-device: remove wlr_data_source.seat_client
Since the source doesn't always come from a client, this field
doesn't make sense. It is replaced by a new "finalized" field in
wlr_client_data_source. This is used to make sure set_actions is
not sent after start_drag has been sent.

A check in data_offer_choose_action has been removed: if an offer
has been sent then start_drag has been called, no need to check.

I also wanted to add a check for wl_data_source.offer, but it
turns out (1) this isn't in the spec (2) it breaks GTK+.

This is some preliminary work for Firefox on Wayland compatibility.
2018-10-07 16:01:57 +02:00
emersion 5d37b14116
data-device: make sure resources are correctly destroyed 2018-05-03 20:22:51 +01:00
emersion 1e563e7ecf
data-device: split into multiple files 2018-05-02 18:04:10 +01:00