11pub mod core;
2+ #[ cfg( feature = "dmabuf" ) ]
23pub mod dmabuf;
34pub mod util;
45pub mod xdg;
@@ -16,6 +17,7 @@ use core::{
1617 display:: Display ,
1718 surface:: WL_SURFACE_REGISTRY ,
1819} ;
20+ #[ cfg( feature = "dmabuf" ) ]
1921use dmabuf:: buffer_params:: BufferParams ;
2022use mint:: Vector2 ;
2123use std:: {
@@ -28,15 +30,14 @@ use std::{
2830use tokio:: { net:: UnixStream , sync:: mpsc, task:: AbortHandle } ;
2931use tokio_stream:: StreamExt ;
3032use tracing:: { debug_span, instrument} ;
33+ #[ cfg( feature = "dmabuf" ) ]
34+ use waynest:: server:: protocol:: stable:: linux_dmabuf_v1:: zwp_linux_buffer_params_v1:: ZwpLinuxBufferParamsV1 ;
3135use waynest:: {
3236 server:: {
3337 self ,
3438 protocol:: {
3539 core:: wayland:: { wl_buffer:: WlBuffer , wl_callback:: WlCallback , wl_display:: WlDisplay } ,
36- stable:: {
37- linux_dmabuf_v1:: zwp_linux_buffer_params_v1:: ZwpLinuxBufferParamsV1 ,
38- xdg_shell:: xdg_toplevel:: XdgToplevel ,
39- } ,
40+ stable:: xdg_shell:: xdg_toplevel:: XdgToplevel ,
4041 } ,
4142 } ,
4243 wire:: { DecodeError , ObjectId } ,
@@ -98,7 +99,9 @@ pub fn get_free_wayland_socket_path() -> Option<PathBuf> {
9899pub enum Message {
99100 Frame ( Arc < Callback > ) ,
100101 ReleaseBuffer ( Arc < Buffer > ) ,
102+ #[ cfg( feature = "dmabuf" ) ]
101103 DmabufImportSuccess ( Arc < BufferParams > , Arc < Buffer > ) ,
104+ #[ cfg( feature = "dmabuf" ) ]
102105 DmabufImportFailure ( Arc < BufferParams > ) ,
103106 CloseToplevel ( Arc < Toplevel > ) ,
104107 ResizeToplevel {
@@ -203,9 +206,11 @@ impl WaylandClient {
203206 client. remove ( callback. 0 ) ;
204207 callback. done ( client, callback. 0 , serial) . await
205208 }
209+ #[ cfg( feature = "dmabuf" ) ]
206210 Message :: DmabufImportSuccess ( params, buffer) => {
207211 params. created ( client, params. id , buffer. id ) . await
208212 }
213+ #[ cfg( feature = "dmabuf" ) ]
209214 Message :: DmabufImportFailure ( params) => {
210215 client. remove ( params. id ) ;
211216 params. failed ( client, params. id ) . await
0 commit comments