On Wayland, make wl_subcompositor protocol optional

This protocol is only used for (optional) Client Side Decorations
(where) the compositor still takes the burden of compositing various
window parts together, via subsurfaces that all belong to a single
window.

If this core protocol is not available, as is the case on gamescope,
disable CSD.
This commit is contained in:
Marijn Suijten
2023-12-14 18:04:15 +01:00
committed by GitHub
parent 3eea505440
commit becdd0dbd2
3 changed files with 17 additions and 10 deletions

View File

@@ -254,7 +254,7 @@ impl WindowState {
&mut self,
configure: WindowConfigure,
shm: &Shm,
subcompositor: &Arc<SubcompositorState>,
subcompositor: &Option<Arc<SubcompositorState>>,
event_sink: &mut EventSink,
) -> LogicalSize<u32> {
// NOTE: when using fractional scaling or wl_compositor@v6 the scaling
@@ -265,10 +265,11 @@ impl WindowState {
self.stateless_size = self.size;
}
if configure.decoration_mode == DecorationMode::Client
&& self.frame.is_none()
&& !self.csd_fails
{
if let Some(subcompositor) = subcompositor.as_ref().filter(|_| {
configure.decoration_mode == DecorationMode::Client
&& self.frame.is_none()
&& !self.csd_fails
}) {
match WinitFrame::new(
&self.window,
shm,