Commit Graph

2278 Commits

Author SHA1 Message Date
Tadeo Kondrak
efab39642e protocol: Add type attribute to events
This allows specifying events to be destructors, which is useful for
non-C language bindings. It is unused in wayland-scanner.

Signed-off-by: Tadeo Kondrak <me@tadeo.ca>
2021-01-27 17:49:10 +00:00
Simon Ser
f1cc5d0c37 build: re-open master for regular development 2021-01-27 18:45:57 +01:00
Simon Ser
e60398b175 build: bump to version 1.19.0 for the official release 2021-01-27 17:48:01 +01:00
Simon Ser
0344e08ce0 build: bump to 1.18.93 for the RC1 release 2021-01-20 22:35:34 +01:00
Simon Ser
db8b64ca5e protocol: sync wl_shm.format with libdrm 2.4.104
This adds 4 new formats.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
2021-01-19 17:16:54 +01:00
Loïc Yhuel
d32e77692c server: Allow absolute paths in WAYLAND_DISPLAY
The compositor should handle absolute paths in WAYLAND_DISPLAY like the clients, ie not
adding the XDG_RUNTIME_DIR prefix if it's an absolute path.

This allows to create the wayland socket in a separate directory for system compositors if
desired. Clients could then directly inherit the environment variable.

Signed-off-by: Loïc Yhuel <loic.yhuel@softathome.com>
2021-01-13 17:01:15 +01:00
Simon Ser
69b8eaf385
build: bump to version 1.18.92 for the beta release 2021-01-06 20:18:58 +01:00
Simon Ser
d01dee9784 Remove TODO
These TODO items are outdated (either done or not applicable anymore). Let's
migrate items that we want to keep to GitLab issues.

Signed-off-by: Simon Ser <contact@emersion.fr>
2020-12-28 10:15:28 +00:00
Loïc Yhuel
74182eb605 meson: link with -lrt if needed for clock_gettime
This is already done in autotools, and fixes the build with glibc < 2.17.

Signed-off-by: Loïc Yhuel <loic.yhuel@softathome.com>
2020-12-23 15:37:58 +01:00
Simon Ser
ea09c2fde7
build: bump to version 1.18.91 for the alpha release 2020-12-21 11:16:05 +01:00
Maxime Roussin-Bélanger
dad8575a4b server: fix typos 2020-12-17 16:03:14 -05:00
Maxime Roussin-Bélanger
4c086a8ce2 egl: fix typo "Backards" 2020-12-17 16:03:14 -05:00
Maxime Roussin-Bélanger
0f0951d5c4 cursor: fix typo "insufficent" 2020-12-17 16:03:14 -05:00
Maxime Roussin-Bélanger
b52e71c8ec CONTRIBUTING: fix typo "excercising" 2020-12-17 16:03:14 -05:00
Maxime Roussin-Bélanger
efa5e3c8c6 tests: fix typos 2020-12-17 16:03:14 -05:00
Maxime Roussin-Bélanger
0f5cc8b71b doc: fix typos 2020-12-17 16:03:14 -05:00
Simon Ser
6741dafbf7 protocol: deprecate non-current wl_output.mode
The current wl_output.mode event has several issues when used to advertise
modes that aren't current:

- It's not possible to remove some modes. This is an issue for virtual
  outputs and when the kernel prunes some modes because of link limitations.
- wl_output.mode fails to carry metadata such as aspect ratio, which results
  in duplicated or missing modes.
- It's not clear, given the current set of protocols, how non-current modes
  are useful to clients. Xwayland ignores non-current modes.

GNOME and wlroots already only advertise the current mode because of these
issues.

If a protocol needs the clients to know about all available modes, it should
advertise these modes itself instead of relying on wl_output.mode.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/wayland/wayland/-/issues/92
2020-10-29 13:07:20 +00:00
Simon Ser
d42b39ccab protocol: make it clear wl_surface.enter/leave are not for frame throttling
Some clients rely on wl_surface.enter/leave to start/stop their rendering
loop.

There are cases where this doesn't work:

- Some compositors don't send wl_surface.leave when a toplevel is hidden.
  For instance Sway doesn't send this event when a toplevel is on an inactive
  workspace (but doesn't send wl_surface.frame events).
- Some compositors might still want applications to continue to render even if
  away from outputs. For instance a compositor that allows to screen record
  individual toplevels might not send a wl_surface.enter event for hidden
  toplevels.

Signed-off-by: Simon Ser <contact@emersion.fr>
2020-10-29 13:02:50 +00:00
ganjing
1ea08d748c cursor/convert_font.c: malloc cannot guarantee that the memory allocated is always successful 2020-10-29 13:00:20 +00:00
Alyssa Ross
e53e0edf0f doc: make reproducible
This setting makes Docbook section IDs consistent, and should allow
Wayland builds that include documentation to be fully reproducible.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
2020-10-29 12:56:15 +00:00
Nick Diego Yamane
53dd99793d protocol: Clarify how clients can cancel a drag operation
Explicitly say that destroying a wl_data_source previously used in a
wl_data_device::start_drag request will cancel the DND session. This
is currently the only way to do it from client side (besides those
"indirect" ones already documented) and all compositors work like that
but it is not clear spec-wise it is the expected behaviour.

Signed-off-by: Nick Diego Yamane <nickdiego@igalia.com>
2020-10-29 12:17:28 +00:00
Valentin
1ab6a81816 Fix undefined behavior
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>
2020-09-04 12:27:33 +02:00
Valentin
fc3beac71f Use fixed size integer type
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>
2020-09-04 12:27:23 +02:00
Peter Hutterer
9b7171f955 Add a basic gitlab issue template
This makes the Bug template available in the new issues form. Ideally a majority
of users will select this template and then realize that they're in the wrong
repo.

Making this a default is a feature of the enterprise gitlab version only, see
https://docs.gitlab.com/ce/user/project/description_templates.html#overview

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-18 07:57:26 +00:00
Christopher James Halse Rogers
4e16ef0aed
protocol: Minor gramatical fix.
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2020-08-14 10:30:22 +10:00
Simon Ser
1dfd2169da
protocol: disambiguate key codes in wl_keyboard.key
Explain that wl_keyboard.key yields platform-specific key codes.
Some compositors use Linux key codes (defined in the
linux/input-event-codes.h header file, e.g. KEY_ESC), however
clients should not assume that this is always the case. The only
reliable way for clients to interpret key codes is to feed them
into a keyboard mapping.

Signed-off-by: Simon Ser <contact@emersion.fr>
2020-06-16 11:35:14 +02:00
Kirill Chibisov
57b7c7d946 Clarify clients behavior on wl_keyboard.leave
Clients must assume that every key, including modifiers, are lifted
after getting wl_keyboard.leave event, not doing so could lead to key repeat
keep going after the user changes focus, or stuck modifiers, when the user
interacts with client without keyboard focus.

Signed-off-by: Kirill Chibisov <contact@kchibisov.com>
2020-06-12 21:15:11 +00:00
Kirill Chibisov
4aa6eb868a Clarify the order of wl_keyboard.modifiers
Consider that we set the modifier for the modifier key as well, and that
you have the option to change your layout when both shifts pressed. This
realized by making the shift keys produce 'Group_switch' when you press
the shift key and the shift modifier is already active. So sending modifier
before the key event will result in 'Group_switch' each time you press
shift.

That being said, the order of modifiers should be updated after the
key/enter event, so it'll only affect future keypresses, not the current one.

See: https://lists.x.org/archives/xorg-devel/2014-July/043110.html

Signed-off-by: Kirill Chibisov <contact@kchibisov.com>
2020-06-12 21:15:11 +00:00
Emmanuel Gil Peyrot
a61ae8eca8 doc: Document libwayland-cursor with meson
Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
2020-06-05 11:05:20 +00:00
Emmanuel Gil Peyrot
3feed6e723 doc: Document libwayland-cursor with autotools
Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
2020-06-05 11:05:20 +00:00
Emmanuel Gil Peyrot
c81cbae3f2 cursor: Properly document wl_cursor_image and wl_cursor
Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
2020-06-05 11:05:20 +00:00
Emmanuel Gil Peyrot
95a3272625 cursor: Use spaces for alignment in the header
Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
2020-06-05 11:05:20 +00:00
Simon Ser
21fad23a47 protocol: add seat missing_capability error
The protocol says:

> It is a protocol violation to issue this request on a seat that
> has never had the pointer capability.

But never defines an error code.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/wayland/wayland/-/issues/165
2020-06-05 09:36:39 +00:00
Peter Hutterer
cf20f24140 gitlab CI: update to use the fdo ci templates
Instead of building a new debian image every time we build the repo, let's build
it once and re-use it. This way we're more  likely to spot actual bugs vs issues
with the distribution (or mirrors). This is the same approach mesa, gstreamer,
libinput, etc. already use.

The pipeline consists of two parts: container-build and distribution-image. Both
use the FDO_DISTRIBUTION_... variables to do their thing, the former to build an
image, the latter to use that image. The container-build step is a noop if an
image with that tag already exists in the registry, the templates take care of
all that.

The .debian.buster section groups the variables needed to easily extend all jobs
requiring buster. Not all variables are used by all jobs but meh.

The grouping is slightly odd because some debian-specific variables are in
the global variables and others in the .debian.buster section. This grouping
will make things easier if we extend to build on other distributions - then we
have all packages and tags in one place.

Because buster doesn't have a recent-enough version of meson, we install that
from pip.

Fixes #79

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-06-05 09:33:31 +10:00
Peter Hutterer
94c036d72b editorconfig: add settings for the .gitlab-ci.yml file
Different indentation and we don't want a fixed line length here, wrapping yaml
is prone to introduce bugs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-06-05 08:22:34 +10:00
Yann Dirson
ef611a803e doc: fix and clarify pointer image behaviour
Signed-off-by: Yann Dirson <ydirson@free.fr>
2020-06-03 12:49:43 +00:00
Peter Hutterer
df969706f4 Replace initial 8 spaces with a tab for all xml files
This is the style used in wayland.xml which is the only file we really
care about for git blame information. So let's adjust all others to that
style for consistency and fix editorconfig to avoid messing this up in
the future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-04-29 12:21:33 +00:00
Guido Günther
cc8b6aa3d9 scanner: Guard interface declarations
This allows to include client and server headers in the same file
fixing warnings like

In file included from ../subprojects/wlroots/include/wlr/types/wlr_layer_shell_v1.h:16,
                 from ../src/desktop.h:16,
                 from ../src/server.h:13,
                 from ../tests/testlib.c:8:
tests/59830eb@@footest@sta/wlr-layer-shell-unstable-v1-protocol.h:80:34: warning: redundant redeclaration of ‘zwlr_layer_shell_v1_interface’ [-Wredundant-decls]
   80 | extern const struct wl_interface zwlr_layer_shell_v1_interface;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../tests/testlib.h:8,
                 from ../tests/testlib.c:7:
tests/59830eb@@footest@sta/wlr-layer-shell-unstable-v1-client-protocol.h:77:34: note: previous declaration of ‘zwlr_layer_shell_v1_interface’ was here
   77 | extern const struct wl_interface zwlr_layer_shell_v1_interface;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../subprojects/wlroots/include/wlr/types/wlr_layer_shell_v1.h:16,
                 from ../src/desktop.h:16,
                 from ../src/server.h:13,
                 from ../tests/testlib.c:8:
tests/59830eb@@footest@sta/wlr-layer-shell-unstable-v1-protocol.h:106:34: warning: redundant redeclaration of ‘zwlr_layer_surface_v1_interface’ [-Wredundant-decls]
  106 | extern const struct wl_interface zwlr_layer_surface_v1_interface;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../tests/testlib.h:8,
                 from ../tests/testlib.c:7:
tests/59830eb@@footest@sta/wlr-layer-shell-unstable-v1-client-protocol.h:103:34: note: previous declaration of ‘zwlr_layer_surface_v1_interface’ was here
  103 | extern const struct wl_interface zwlr_layer_surface_v1_interface;

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Closes: #158
2020-04-23 10:17:18 +02:00
Simon Ser
7d3d2ae310
doc/man: remove manually written man pages
There is only one page written. Having manually-written man pages duplicates
information with doc comments. Besides, man pages are already generated by
Doxygen.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/wayland/wayland/-/issues/156
2020-04-16 19:53:28 +02:00
Simon Ser
24ca1a5b57
client: improve wl_display_connect docs
Add a paragraph about WAYLAND_SOCKET and describe what happens when the display
name is a relative path.

Signed-off-by: Simon Ser <contact@emersion.fr>
2020-04-16 19:49:12 +02:00
Ricardo Quesada
25f216d97f README with upadated compile instructions
This commit updates the README build & install instructions.
It replaces that obsolete "autogen && make" with "meson && ninja"

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2020-04-07 10:55:19 -07:00
Matt Turner
6d44973710 meson: Deduplicate generation of wayland-version.h
Signed-off-by: Matt Turner <mattst88@gmail.com>
2020-03-18 13:37:25 -07:00
Matt Turner
9f9e971f56 meson: Raise requirement to meson >= 0.52.1
Many new and valuable features were added between Meson 0.49 and 0.52.1.
We would like to use some of them.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2020-03-18 13:36:44 -07:00
Matt Turner
d840681707 .gitlab-ci.yml: Switch from Stretch to Buster
Stretch is old-stable and will reach end of life this year.

buster-backports has newer Meson available, so switching to Buster will
allow us to bump the Meson requirements.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2020-03-18 13:35:25 -07:00
Matt Turner
618663c791 meson: Add option to control building wayland-scanner
Wayland requires a binary, wayland-scanner, to be run during the build
process. For any configuration other than native builds (including
cross compiling and even 32-bit x86 builds on an x86-64 build machine)
Wayland's build process builds and uses its own wayland-scanner.

For any builds using a cross file, wayland-scanner is built for the host
machine and therefore cannot be executed during the build of the Wayland
libraries. Instead builds using a cross file must execute the build
machine's wayland-scanner (typically /usr/bin/wayland-scanner).

As such, to build Wayland's libraries for a non-native ABI a package
manager must build and install /usr/bin/wayland-scanner first. But then
the build for the native ABI then rebuilds wayland-scanner itself and
doesn't use the system's, and worse, wants to install its own, which
conflicts with the /usr/bin/wayland-scanner already installed!

So, add the -Dscanner=... option to control whether to install
wayland-scanner.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2020-03-13 10:25:24 -07:00
Matt Turner
5ddb8dff87 meson: Require wayland-scanner of a matching version
We have always built libwayland with the scanner from the same build so
that the generated code and installed headers are exactly up-to-date
with the libwayland version. If libwayland was to use a scanner later
than itself, the scanner might do things that are not available in the
libwayland at hand, leading to a broken build or a broken library
(headers).

Signed-off-by: Matt Turner <mattst88@gmail.com>
2020-03-09 11:31:50 -07:00
Simon Ser
8d5fadad47 protocol: add invalid_size error to wl_surface
This allows the compositor to send an error when the client submits a buffer
whose size is not divisible by the buffer scale. Previously, the protocol said
it was a client error but didn't specify any error code.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/wayland/wayland/issues/145
2020-03-05 14:48:36 +00:00
Tomek Bury
ef40f82ac1 util: fix compiler warning
conversion to 'wl_fixed_t {aka int}' from 'int64_t {aka long int}'
may alter its value [-Werror=conversion]
2020-02-24 11:02:44 +00:00
Jan Beich
230885ebb4 cursor/os-compatibility: move resizing into a separate function
Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
2020-02-23 20:42:54 +00:00
Jan Beich
3a3dd0820d cursor: ignore posix_fallocate in shm_pool_resize if not supported by FS
Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
2020-02-23 20:42:54 +00:00