mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user