@@ -18,6 +18,11 @@ use wayland_protocols_wlr::screencopy::v1::client::zwlr_screencopy_manager_v1::Z
1818
1919use super :: super :: state:: { WaylandGlobals , WaylandState } ;
2020
21+ // Freeze/zoom capture currently consumes wl_shm buffer events and ignores linux-dmabuf.
22+ // Version 3 can negotiate linux-dmabuf-only frames on newer wlroots/NVIDIA stacks, so
23+ // bind through v2 until dmabuf capture is implemented.
24+ const MAX_SHM_SCREENCOPY_VERSION : u32 = 2 ;
25+
2126pub ( super ) struct WaylandSetup {
2227 pub ( super ) conn : Connection ,
2328 #[ cfg( tablet) ]
@@ -108,7 +113,11 @@ pub(super) fn setup_wayland() -> Result<WaylandSetup> {
108113 debug ! ( "Pointer constraints global not available" ) ;
109114 }
110115
111- let screencopy_manager = match globals. bind :: < ZwlrScreencopyManagerV1 , _ , _ > ( & qh, 1 ..=3 , ( ) ) {
116+ let screencopy_manager = match globals. bind :: < ZwlrScreencopyManagerV1 , _ , _ > (
117+ & qh,
118+ 1 ..=MAX_SHM_SCREENCOPY_VERSION ,
119+ ( ) ,
120+ ) {
112121 Ok ( manager) => {
113122 debug ! ( "Bound zwlr_screencopy_manager_v1" ) ;
114123 Some ( manager)
@@ -148,3 +157,13 @@ pub(super) fn setup_wayland() -> Result<WaylandSetup> {
148157 layer_shell_available,
149158 } )
150159}
160+
161+ #[ cfg( test) ]
162+ mod tests {
163+ use super :: MAX_SHM_SCREENCOPY_VERSION ;
164+
165+ #[ test]
166+ fn screencopy_binding_stays_on_wl_shm_compatible_version ( ) {
167+ assert_eq ! ( MAX_SHM_SCREENCOPY_VERSION , 2 ) ;
168+ }
169+ }
0 commit comments