sf-compositor: the protocols gamescope needs, so Steam can start

gamescope (which hosts the Steam client) refuses to run nested without
wp_presentation, zwp_relative_pointer_manager_v1 and
zwp_pointer_constraints_v1 ("Couldn't create Wayland objects"), so Steam
quit right away.

- presentation-time with real feedback: on DRM with the page flip's
  kernel timestamp and sequence, on winit when the frame is submitted;
- relative pointer and pointer constraints (the seat gets a wl_pointer;
  no pointer device is attached, the cursor theme is blank).

Tested in the install VM: gamescope now gets past the Wayland setup; it
stops later only because the VM has no hardware Vulkan (llvmpipe lacks
VK_EXT_physical_device_drm). YouTube (Chromium, which uses presentation
feedback too) still renders and takes input.

Shell 0.3.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Tamas Csikel
2026-10-25 20:20:31 +01:00
parent 62c3056f52
commit 54cdaf5e35
6 changed files with 119 additions and 30 deletions

View File

@@ -9,7 +9,9 @@ use smithay::backend::renderer::gles::GlesRenderer;
use smithay::backend::winit::{self, WinitEvent, WinitGraphicsBackend};
use smithay::output::{Mode, Output, PhysicalProperties, Subpixel};
use smithay::reexports::calloop::EventLoop;
use smithay::reexports::wayland_protocols::wp::presentation_time::server::wp_presentation_feedback;
use smithay::utils::Transform;
use std::time::Duration;
use crate::output_mgmt::{ModeInfo, OutputModes, PendingConfig};
use crate::state::{App, Backend, State};
@@ -86,8 +88,15 @@ fn render(app: &mut App) {
}
};
if let Some(damage) = damage {
if let Err(e) = w.backend.submit(Some(&damage)) {
tracing::warn!("submit: {e:?}");
let feedback = app.state.presentation_feedback();
match w.backend.submit(Some(&damage)) {
Ok(()) => {
if let Some(mut f) = feedback {
let refresh = smithay::wayland::presentation::Refresh::fixed(Duration::from_micros(16_667));
f.presented::<_, smithay::utils::Monotonic>(app.state.clock.now(), refresh, 0, wp_presentation_feedback::Kind::Vsync);
}
}
Err(e) => tracing::warn!("submit: {e:?}"),
}
}
app.state.send_frames();