@@ -15,7 +15,7 @@ use smithay_client_toolkit::{
1515 shm:: { slot:: SlotPool , Shm , ShmHandler } ,
1616} ;
1717use wayland_client:: {
18- globals:: { registry_queue_init , GlobalListHandler } ,
18+ globals:: { GlobalListHandler , registry_queue_init } ,
1919 protocol:: { wl_output, wl_shm, wl_surface} ,
2020 Connection , Dispatch , QueueHandle ,
2121} ;
@@ -36,7 +36,7 @@ fn main() {
3636
3737 // The compositor (not to be confused with the server which is commonly called the compositor) allows
3838 // configuring surfaces to be presented.
39- let compositor = CompositorState :: bind ( & globals, & qh) . expect ( "wl_compositor not available" ) ;
39+ let compositor = CompositorState :: bind_singleton ( & globals, & qh) . expect ( "wl_compositor not available" ) ;
4040 // For desktop platforms, the XDG shell is the standard protocol for creating desktop windows.
4141 let xdg_shell = XdgShell :: bind ( & globals, & qh) . expect ( "xdg shell is not available" ) ;
4242 // Since we are not using the GPU in this example, we use wl_shm to allow software rendering to a buffer
@@ -111,8 +111,13 @@ fn main() {
111111
112112 let pool = SlotPool :: new ( pool_size as usize , & shm) . expect ( "Failed to create pool" ) ;
113113
114- let mut state =
115- State { output_state : OutputState :: new ( & globals, & qh) , shm, wp_viewporter, pool, windows } ;
114+ let mut state = State {
115+ output_state : OutputState :: new ( & globals, & qh) ,
116+ shm,
117+ wp_viewporter,
118+ pool,
119+ windows,
120+ } ;
116121
117122 // We don't draw immediately, the configure will notify us when to first draw.
118123
0 commit comments