Added wlroots 0.16.1

This commit is contained in:
Gerben Jan Dijkman 2023-01-10 17:04:53 +01:00
parent ed97c8b841
commit cbf863f648
6 changed files with 90 additions and 242 deletions

View File

@ -1 +1,2 @@
DIST wlroots-0.15.1.tar.gz 565816 BLAKE2B 09b704a55d8b4a5ab19bb0fcdd041635fbbbb8eed94ff6d189ef47f9f86e90178efa8441c7db78839b1145ed79ed016d520d6599e256cdcf49130cda38bc307d SHA512 6228160f2f350a406c612f1048d7075cf2f78206cc84bc16f889d5d0acd614f9e98845fffed03d7067cfdbd7558b77fcc5d8cedc3868d866e476523126a63677
DIST wlroots-0.16.1.tar.gz 588945 BLAKE2B bd7dae29ef730c32ade389bbc1f99610afc0c35fc05a5c80e9257d6eb2ca99c38ecb6277206015432033c59c11fab4743f49413a6a19cf1d35cdbe62cdb57925 SHA512 a590960d3a228f1fec007d20094e48d9276568f59e2ce3bac56889fb7df519d68ffb81a73130b7bbf350ec95056009aaabb18ada52a97486d6ad1d5deb6844c3

View File

@ -1,30 +0,0 @@
From 13fcdba75cf5f21cfd49c1a05f4fa62f77619b40 Mon Sep 17 00:00:00 2001
From: Sebastian Krzyszkowiak <dos@dosowisko.net>
Date: Sat, 5 Mar 2022 08:00:39 +0100
Subject: [PATCH] wlr_output_layout_contains_point: handle outputs that aren't
in the layout
Instead of crashing, return `false` when the specified output isn't part
of the layout, as we can be sure that it doesn't contain the specified
point.
---
types/wlr_output_layout.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/types/wlr_output_layout.c b/types/wlr_output_layout.c
index 28d91e8d4..ef6e2850c 100644
--- a/types/wlr_output_layout.c
+++ b/types/wlr_output_layout.c
@@ -231,6 +231,9 @@ bool wlr_output_layout_contains_point(struct wlr_output_layout *layout,
if (reference) {
struct wlr_output_layout_output *l_output =
wlr_output_layout_get(layout, reference);
+ if (!l_output) {
+ return false;
+ }
struct wlr_box output_box;
output_layout_output_get_box(l_output, &output_box);
return wlr_box_contains_point(&output_box, lx, ly);
--
GitLab

View File

@ -1,144 +0,0 @@
From 17b2b06633729f1826715c1d0b84614aa3cedb3a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Mon, 28 Feb 2022 13:49:32 +0100
Subject: [PATCH] seat: Allow to cancel touches
After cancelation we destroy the touch points associated with this
surface as the Wayland spec says:
No further events are sent to the clients from that particular gesture.
Touch cancellation applies to all touch points currently active on this
client's surface. The client is responsible for finalizing the touch
points, future touch points on this surface may re-use the touch point
ID.
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/2999
---
include/wlr/types/wlr_seat.h | 21 ++++++++++++++++--
types/seat/wlr_seat_touch.c | 42 ++++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+), 2 deletions(-)
diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h
index ebbcfd479..1946873ae 100644
--- a/include/wlr/types/wlr_seat.h
+++ b/include/wlr/types/wlr_seat.h
@@ -119,9 +119,11 @@ struct wlr_touch_grab_interface {
void (*enter)(struct wlr_seat_touch_grab *grab, uint32_t time_msec,
struct wlr_touch_point *point);
void (*frame)(struct wlr_seat_touch_grab *grab);
- // XXX this will conflict with the actual touch cancel which is different so
- // we need to rename this
+ // Cancel grab
void (*cancel)(struct wlr_seat_touch_grab *grab);
+ // Send wl_touch::cancel
+ void (*wl_cancel)(struct wlr_seat_touch_grab *grab,
+ struct wlr_surface *surface);
};
/**
@@ -613,6 +615,14 @@ void wlr_seat_touch_send_up(struct wlr_seat *seat, uint32_t time_msec,
void wlr_seat_touch_send_motion(struct wlr_seat *seat, uint32_t time_msec,
int32_t touch_id, double sx, double sy);
+/**
+ * Notify the seat that this is a global gesture and the client should cancel
+ * processing it. The event will go to the client for the surface given.
+ * This function does not respect touch grabs: you probably want
+ * `wlr_seat_touch_notify_cancel()` instead.
+ */
+void wlr_seat_touch_send_cancel(struct wlr_seat *seat, struct wlr_surface *surface);
+
void wlr_seat_touch_send_frame(struct wlr_seat *seat);
/**
@@ -639,6 +649,13 @@ void wlr_seat_touch_notify_up(struct wlr_seat *seat, uint32_t time_msec,
void wlr_seat_touch_notify_motion(struct wlr_seat *seat, uint32_t time_msec,
int32_t touch_id, double sx, double sy);
+/**
+ * Notify the seat that this is a global gesture and the client should
+ * cancel processing it. Defers to any grab of the touch device.
+ */
+void wlr_seat_touch_notify_cancel(struct wlr_seat *seat,
+ struct wlr_surface *surface);
+
void wlr_seat_touch_notify_frame(struct wlr_seat *seat);
/**
diff --git a/types/seat/wlr_seat_touch.c b/types/seat/wlr_seat_touch.c
index 65a8c7c06..abc17ae2c 100644
--- a/types/seat/wlr_seat_touch.c
+++ b/types/seat/wlr_seat_touch.c
@@ -41,6 +41,11 @@ static void default_touch_cancel(struct wlr_seat_touch_grab *grab) {
// cannot be cancelled
}
+static void default_touch_wl_cancel(struct wlr_seat_touch_grab *grab,
+ struct wlr_surface *surface) {
+ wlr_seat_touch_send_cancel(grab->seat, surface);
+}
+
const struct wlr_touch_grab_interface default_touch_grab_impl = {
.down = default_touch_down,
.up = default_touch_up,
@@ -48,6 +53,7 @@ const struct wlr_touch_grab_interface default_touch_grab_impl = {
.enter = default_touch_enter,
.frame = default_touch_frame,
.cancel = default_touch_cancel,
+ .wl_cancel = default_touch_wl_cancel,
};
@@ -238,6 +244,26 @@ void wlr_seat_touch_notify_frame(struct wlr_seat *seat) {
}
}
+void wlr_seat_touch_notify_cancel(struct wlr_seat *seat,
+ struct wlr_surface *surface) {
+ struct wlr_seat_touch_grab *grab = seat->touch_state.grab;
+ if (grab->interface->wl_cancel) {
+ grab->interface->wl_cancel(grab, surface);
+ }
+
+ struct wl_client *client = wl_resource_get_client(surface->resource);
+ struct wlr_seat_client *seat_client = wlr_seat_client_for_wl_client(seat, client);
+ if (seat_client == NULL) {
+ return;
+ }
+ struct wlr_touch_point *point, *tmp;
+ wl_list_for_each_safe(point, tmp, &seat->touch_state.touch_points, link) {
+ if (point->client == seat_client) {
+ touch_point_destroy(point);
+ }
+ }
+}
+
static void handle_point_focus_destroy(struct wl_listener *listener,
void *data) {
struct wlr_touch_point *point =
@@ -376,6 +402,22 @@ void wlr_seat_touch_send_frame(struct wlr_seat *seat) {
}
}
+void wlr_seat_touch_send_cancel(struct wlr_seat *seat, struct wlr_surface *surface) {
+ struct wl_client *client = wl_resource_get_client(surface->resource);
+ struct wlr_seat_client *seat_client = wlr_seat_client_for_wl_client(seat, client);
+ if (seat_client == NULL) {
+ return;
+ }
+
+ struct wl_resource *resource;
+ wl_resource_for_each(resource, &seat_client->touches) {
+ if (seat_client_from_touch_resource(resource) == NULL) {
+ continue;
+ }
+ wl_touch_send_cancel(resource);
+ }
+}
+
int wlr_seat_touch_num_points(struct wlr_seat *seat) {
return wl_list_length(&seat->touch_state.touch_points);
}
--
GitLab

View File

@ -1,49 +0,0 @@
From 8dec751a6d84335fb04288b8efab6dd5c90288d3 Mon Sep 17 00:00:00 2001
From: Isaac Freund <ifreund@ifreund.xyz>
Date: Fri, 9 Oct 2020 15:28:07 +0200
Subject: [PATCH] layer-shell: error on 0 dimension without anchors
The protocol requires clients to set opposing anchors when requesting
a width or height of 0.
The goal of this patch is not to break clients that rely on this
behavior but to improve the consistency of the layer shell ecosystem
through adherence to the protocol.
---
types/wlr_layer_shell_v1.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/types/wlr_layer_shell_v1.c b/types/wlr_layer_shell_v1.c
index d83b22b86..bc6811179 100644
--- a/types/wlr_layer_shell_v1.c
+++ b/types/wlr_layer_shell_v1.c
@@ -307,6 +307,26 @@ static void layer_surface_role_commit(struct wlr_surface *wlr_surface) {
return;
}
+ const uint32_t horiz = ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT |
+ ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT;
+ if (surface->client_pending.desired_width == 0 &&
+ (surface->client_pending.anchor & horiz) != horiz) {
+ wl_resource_post_error(surface->resource,
+ ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_SIZE,
+ "width 0 requested without setting left and right anchors");
+ return;
+ }
+
+ const uint32_t vert = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP |
+ ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM;
+ if (surface->client_pending.desired_height == 0 &&
+ (surface->client_pending.anchor & vert) != vert) {
+ wl_resource_post_error(surface->resource,
+ ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_SIZE,
+ "height 0 requested without setting top and bottom anchors");
+ return;
+ }
+
if (surface->closed) {
// Ignore commits after the compositor has closed it
return;
--
GitLab

View File

@ -8,26 +8,15 @@ inherit meson
DESCRIPTION="Pluggable, composable, unopinionated modules for building a Wayland compositor with updates from pureos (for phoc)"
HOMEPAGE="https://source.puri.sm/Librem5/wlroots"
#COMMIT="1f8bb9e0e3058fc31a14866dc52e8f83c1287a09"
#SRC_URI="https://source.puri.sm/Librem5/wlroots/-/archive/${COMMIT}/wlroots-${COMMIT}.tar.gz -> ${P}.tar.gz"
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://gitlab.freedesktop.org/${PN}/${PN}.git"
inherit git-r3
SLOT="0/9999"
else
SRC_URI="https://gitlab.freedesktop.org/${PN}/${PN}/-/archive/${PV}/${P}.tar.gz"
KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~x86"
SLOT="0/$(ver_cut 2)"
fi
SRC_URI="https://gitlab.freedesktop.org/${PN}/${PN}/-/archive/${PV}/${P}.tar.gz"
KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~x86"
SLOT="0/$(ver_cut 2)"
KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~x86"
SLOT="0/$(ver_cut 2)"
#S=${WORKDIR}/wlroots-${COMMIT}
LICENSE="MIT"
IUSE="tinywl vulkan x11-backend X"
IUSE="tinywl vulkan x11-backend X +phoc"
DEPEND="
>=dev-libs/libinput-1.14.0:0=
@ -64,11 +53,7 @@ BDEPEND="
PATCHES=(
"${FILESDIR}"/wlroots-0.15.1-tinywl-dont-crash-upon-missing-keyboard.patch
#"${FILESDIR}"/13fcdba75cf5f21cfd49c1a05f4fa62f77619b40.patch
#"${FILESDIR}"/17b2b06633729f1826715c1d0b84614aa3cedb3a.patch
#"${FILESDIR}"/8dec751a6d84335fb04288b8efab6dd5c90288d3.patch
"${FILESDIR}"/dd03d839ab56c3e5d7c607a8d76e58e0b75edb85.patch
)
src_configure() {

View File

@ -0,0 +1,85 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit meson
DESCRIPTION="Pluggable, composable, unopinionated modules for building a Wayland compositor"
HOMEPAGE="https://gitlab.freedesktop.org/wlroots/wlroots"
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://gitlab.freedesktop.org/${PN}/${PN}.git"
inherit git-r3
SLOT="0/9999"
else
SRC_URI="https://gitlab.freedesktop.org/${PN}/${PN}/-/archive/${PV}/${P}.tar.gz"
KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~x86"
SLOT="0/$(ver_cut 2)"
fi
LICENSE="MIT"
IUSE="+hwdata +seatd tinywl +udev vulkan x11-backend X +phoc"
DEPEND="
>=dev-libs/libinput-1.14.0:0=
>=dev-libs/wayland-1.21.0
>=dev-libs/wayland-protocols-1.28
media-libs/mesa[egl(+),gles2]
hwdata? ( sys-apps/hwdata:= )
seatd? ( sys-auth/seatd:= )
udev? ( virtual/libudev )
vulkan? (
dev-util/glslang:0=
dev-util/vulkan-headers:0=
media-libs/vulkan-loader:0=
)
>=x11-libs/libdrm-2.4.114:0=
x11-libs/libxkbcommon
>=x11-libs/pixman-0.42.0:0=
x11-backend? ( x11-libs/libxcb:0= )
X? (
x11-base/xwayland
x11-libs/libxcb:0=
x11-libs/xcb-util-image
x11-libs/xcb-util-wm
)
"
RDEPEND="
${DEPEND}
"
BDEPEND="
>=dev-libs/wayland-protocols-1.24
>=dev-util/meson-0.60.0
dev-util/wayland-scanner
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}"/dd03d839ab56c3e5d7c607a8d76e58e0b75edb85.patch
)
src_configure() {
# xcb-util-errors is not on Gentoo Repository (and upstream seems inactive?)
local emesonargs=(
"-Dxcb-errors=disabled"
$(meson_use tinywl examples)
-Drenderers=$(usex vulkan 'gles2,vulkan' gles2)
-Dxwayland=$(usex X enabled disabled)
-Dbackends=drm,libinput$(usex x11-backend ',x11' '')
)
meson_src_configure
}
src_install() {
meson_src_install
if use tinywl; then
dobin "${BUILD_DIR}"/tinywl/tinywl
fi
}
pkg_postinst() {
elog "You must be in the input group to allow your compositor"
elog "to access input devices via libinput."
}