~scoopta/wofi#137: 
wofi crashes when running with sway 1.5.1

I'm using wofi 1.2.2 in Arch Linux. After upgrading recently to sway 1.5.1 (with wlroots 0.12.0) I get the following error when running wofi --show run:

Gdk-Message: 10:10:28.471: Error 71 (Protocol error) dispatching to Wayland display.

And it doesn't crash if sway is downgraded to 1.5 (with wlroots 0.11.0).

Status
RESOLVED FIXED
Submitter
~yesenarman
Assigned to
No-one
Submitted
3 years ago
Updated
3 years ago
Labels
No labels applied.

~diabonas 3 years ago

This is caused by the upstream wlroots commit "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.

To verify, run WAYLAND_DEBUG=1 wofi, which yields the error

wl_display@1.error(zwlr_layer_surface_v1@33, 1, "width 0 requested without setting left and right anchors")

A quick fix is to set all four anchors for LOCATION_CENTER like this:

diff -r e3db9b8075e7 src/wofi.c
--- a/src/wofi.c        Wed Nov 04 21:10:57 2020 -0800
+++ b/src/wofi.c        Thu Nov 12 10:28:22 2020 +0100
@@ -166,7 +166,8 @@
        }

        if(location > 0) {
-               enum zwlr_layer_surface_v1_anchor anchor = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT;
+               enum zwlr_layer_surface_v1_anchor anchor = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
+                                                          ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT;

                switch(location) {
                case LOCATION_CENTER:

Not having read the specification, I don't know whether that is actually the correct approach, hence no formal patch submission from me.

~cloudninja 3 years ago

I'm running my wofi-hg package and i'm on the current tip of the repo, with updated sway 1.5.1 and wlroots 0.12.0-1 from community on arch. This issue is not happening to me. I don't believe the issue is fixed in the current release so I'd suggest running wofi-hg for the time being.

~diabonas 3 years ago

Oh indeed, I completely overlooked https://hg.sr.ht/~scoopta/wofi/rev/ea517e724b07716986fd2c6a6e321e1b5cb08682 which already fixes this problem.

~diabonas 3 years ago

Filed a downstream bug report in Arch Linux to get this patch backported: https://bugs.archlinux.org/task/68600

~scoopta REPORTED FIXED 3 years ago

As was pointed out this has already been fixed but there hasn't been a release since. I have since released a v1.2.3 that includes the fix. Hopefully for distros that don't backport the patch they'll pull the new release.

Register here or Log in to comment, or comment via email.