Package: wdisplays
Version: 1.0-1
Severity: important
Tags: patch

Under Sway v1.5 as packaged in Debian, wdisplays immediately exits with code 1 
and does not display any dialog.

This seems to be due to a protocol (version) change that wdisplays does not 
expect or handle.  It appears this changed
in Sway v1.5 from v1.4, and a similar change causing a segmentation fault 
exists in Sway vNext.

This change from the upstream GitHub repository resolves the issue, as well as 
resolving an issue with current changes
to Sway's master branch: https://github.com/cyclopsian/wdisplays/pull/20

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 5.8.0-2-amd64 (SMP w/8 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages wdisplays depends on:
ii  libc6                2.31-3
ii  libcairo2            1.16.0-4
ii  libepoxy0            1.5.4-1
ii  libglib2.0-0         2.66.0-2
ii  libgtk-3-0           3.24.23-2
ii  libpango-1.0-0       1.46.2-1
ii  libpangocairo-1.0-0  1.46.2-1
ii  libwayland-client0   1.18.0-2~exp1.1

wdisplays recommends no packages.

wdisplays suggests no packages.

-- debconf-show failed
>From 5198a9c94b40ff157c284df413be5402f1b75118 Mon Sep 17 00:00:00 2001
From: Simon Ser <cont...@emersion.fr>
Date: Wed, 8 Jul 2020 11:57:35 +0200
Subject: [PATCH] Use correct versions when binding globals

Changes to protocols aren't forward-compatible. It's not possible to use
version n+1 when a client has been designed to work with version n. For
instance in wlr-screencopy v5 a new event has been added. Binding to
version 5 without upgrading the client leads to libwayland errors
because libwayland doesn't know how to handle the event.

The client needs to maintain its own version requirements.

Closes: https://github.com/cyclopsian/wdisplays/issues/18
---
 src/outputs.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/outputs.c b/src/outputs.c
index 9ebf7e5..a5007e8 100644
--- a/src/outputs.c
+++ b/src/outputs.c
@@ -534,20 +534,20 @@ static void registry_handle_global(void *data, struct 
wl_registry *registry,
 
   if (strcmp(interface, zwlr_output_manager_v1_interface.name) == 0) {
     state->output_manager = wl_registry_bind(registry, name,
-        &zwlr_output_manager_v1_interface, version);
+        &zwlr_output_manager_v1_interface, 1);
     zwlr_output_manager_v1_add_listener(state->output_manager,
         &output_manager_listener, state);
   } else if (strcmp(interface, zxdg_output_manager_v1_interface.name) == 0) {
     state->xdg_output_manager = wl_registry_bind(registry, name,
-        &zxdg_output_manager_v1_interface, version);
+        &zxdg_output_manager_v1_interface, 2);
   } else if(strcmp(interface, zwlr_screencopy_manager_v1_interface.name) == 0) 
{
     state->copy_manager = wl_registry_bind(registry, name,
-        &zwlr_screencopy_manager_v1_interface, version);
+        &zwlr_screencopy_manager_v1_interface, 1);
   } else if(strcmp(interface, zwlr_layer_shell_v1_interface.name) == 0) {
     state->layer_shell = wl_registry_bind(registry, name,
-        &zwlr_layer_shell_v1_interface, version);
+        &zwlr_layer_shell_v1_interface, 1);
   } else if(strcmp(interface, wl_shm_interface.name) == 0) {
-    state->shm = wl_registry_bind(registry, name, &wl_shm_interface, version);
+    state->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1);
   }
 }
 

Reply via email to