NVIDIA / nvidia-settings

NVIDIA driver control panel
http://www.nvidia.com/object/unix.html
GNU General Public License v2.0
292 stars 75 forks source link

set supported interface version for `wl_output` #99

Open Kiskae opened 1 year ago

Kiskae commented 1 year ago

Prompted by https://github.com/NixOS/nixpkgs/issues/248119

Recent releases of the wayland protocol updated the wl_output protocol to version 4, which added the wl_output@name opcode. Since the nvidia wayland connector does not check the version it advertises support but does not register the required handler for that opcode, resulting in an abort when the callback is invoked.

This PR is based on a similar problem reported in https://github.com/swaywm/sway/issues/6717 and clamps the version to the supported range.

Output with WAYLAND_DEBUG before change:

[2919666.139] wl_output@4.geometry(0, 0, 620, 340, 0, "BNQ", "BenQ EL2870U", 0) [2919666.141] wl_output@4.mode(3, 3840, 2160, 59996) [2919666.142] wl_output@4.scale(2) [2919666.143] wl_output@4.name("DP-4") fish: Job 1, 'WAYLAND_DEBUG=1 nvidia-settings' terminated by signal SIGABRT (Abort)

Output after change:

[2872229.841] wl_output@6.geometry(0, 0, 620, 340, 0, "BNQ", "BenQ EL2870U", 0) [2872229.846] wl_output@6.mode(3, 3840, 2160, 59996) [2872229.848] wl_output@6.scale(2) [2872229.849] wl_output@6.done()

Kiskae commented 11 months ago

Appears to be fixed in 545.29.02, leaving it open since the production branch is still affected.