From 951089d0636bc83c0a3d4b5b4e2254d2821d52df Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Jul 03 2021 02:31:12 +0000 Subject: Add upstream patch for cursor issues on scaled outputs --- diff --git a/wlroots-0.14.0-surface-accept-commits-with-buffer-size-not-divisibl.patch b/wlroots-0.14.0-surface-accept-commits-with-buffer-size-not-divisibl.patch new file mode 100644 index 0000000..acea2c5 --- /dev/null +++ b/wlroots-0.14.0-surface-accept-commits-with-buffer-size-not-divisibl.patch @@ -0,0 +1,57 @@ +From 1c4b5bcab3aa1ca7b2c40fd64f77f90b8dde11d7 Mon Sep 17 00:00:00 2001 +From: Simon Ser +Date: Wed, 30 Jun 2021 09:48:31 +0200 +Subject: [PATCH] surface: accept commits with buffer size not divisible by + scale + +There are still many situations where the buffer scale is not +divisible by scale. The fix will require a tad more work, so +let's just log the client error for now and continue handling +the surface commit as usual. + +Closes: https://github.com/swaywm/sway/issues/6352 +--- + types/wlr_surface.c | 9 ++------- + 1 file changed, 2 insertions(+), 7 deletions(-) + +diff --git a/types/wlr_surface.c b/types/wlr_surface.c +index 969645eba7..512449f239 100644 +--- a/types/wlr_surface.c ++++ b/types/wlr_surface.c +@@ -167,7 +167,7 @@ static void surface_state_viewport_src_size(struct wlr_surface_state *state, + } + } + +-static bool surface_state_finalize(struct wlr_surface *surface, ++static void surface_state_finalize(struct wlr_surface *surface, + struct wlr_surface_state *state) { + if ((state->committed & WLR_SURFACE_STATE_BUFFER)) { + if (state->buffer_resource != NULL) { +@@ -187,7 +187,6 @@ static bool surface_state_finalize(struct wlr_surface *surface, + wlr_log(WLR_DEBUG, "Client bug: submitted a buffer whose size (%dx%d) " + "is not divisible by scale (%d)", state->buffer_width, + state->buffer_height, state->scale); +- return false; + } + + if (state->viewport.has_dst) { +@@ -207,8 +206,6 @@ static bool surface_state_finalize(struct wlr_surface *surface, + pixman_region32_intersect_rect(&state->buffer_damage, + &state->buffer_damage, 0, 0, state->buffer_width, + state->buffer_height); +- +- return true; + } + + static void surface_update_damage(pixman_region32_t *buffer_damage, +@@ -470,9 +467,7 @@ static void surface_commit_state(struct wlr_surface *surface, + } + + static void surface_commit_pending(struct wlr_surface *surface) { +- if (!surface_state_finalize(surface, &surface->pending)) { +- return; +- } ++ surface_state_finalize(surface, &surface->pending); + + if (surface->role && surface->role->precommit) { + surface->role->precommit(surface); diff --git a/wlroots.spec b/wlroots.spec index c7c78d0..27f061a 100644 --- a/wlroots.spec +++ b/wlroots.spec @@ -25,6 +25,8 @@ Source2: https://emersion.fr/.well-known/openpgpkey/hu/dj3498u4hyyarh35rk # - make it self-contained # - only has targets for examples known to compile well (cf. "examples) global) Source3: examples.meson.build +# Disappearing cursor on scaled outputs, swaywm/sway#6352 +Patch0: %{url}/commit/1c4b5bc.patch#/wlroots-0.14.0-surface-accept-commits-with-buffer-size-not-divisibl.patch BuildRequires: gcc BuildRequires: gnupg2 @@ -123,6 +125,7 @@ install -pm0644 -D '%{SOURCE3}' '%{buildroot}/%{_pkgdocdir}/examples/meson.build %changelog * Wed Jun 23 2021 Aleksei Bavshin - 0.14.0-1 - Update to 0.14.0 +- Add upstream patch for cursor issues on scaled outputs * Tue Jun 01 2021 Aleksei Bavshin - 0.13.0-2 - Enable libseat session backend