@@ -22,9 +22,9 @@ use smithay_client_toolkit::{
22
22
} ,
23
23
} ;
24
24
use wayland_client:: {
25
- globals:: { registry_queue_init, GlobalListContents } ,
26
- protocol:: { wl_keyboard, wl_output, wl_pointer, wl_registry , wl_seat, wl_shm, wl_surface} ,
27
- Connection , Dispatch , QueueHandle ,
25
+ globals:: registry_queue_init,
26
+ protocol:: { wl_keyboard, wl_output, wl_pointer, wl_seat, wl_shm, wl_surface} ,
27
+ Connection , QueueHandle ,
28
28
} ;
29
29
30
30
fn main ( ) {
@@ -34,9 +34,9 @@ fn main() {
34
34
35
35
let ( globals, mut event_queue) = registry_queue_init ( & conn) . unwrap ( ) ;
36
36
let qh = event_queue. handle ( ) ;
37
- let registry_state = RegistryState :: new ( & conn , & qh ) ;
38
- let seat_state = SeatState :: new ( ) ;
39
- let output_state = OutputState :: new ( ) ;
37
+ let registry_state = RegistryState :: new ( & globals ) ;
38
+ let seat_state = SeatState :: new ( & globals , & qh ) ;
39
+ let output_state = OutputState :: new ( & globals , & qh ) ;
40
40
let compositor_state =
41
41
CompositorState :: bind ( & globals, & qh) . expect ( "wl_compositor not available" ) ;
42
42
let shm_state = ShmState :: bind ( & globals, & qh) . expect ( "wl_shm not available" ) ;
@@ -84,10 +84,6 @@ fn main() {
84
84
set_cursor : false ,
85
85
} ;
86
86
87
- while !simple_window. registry_state . ready ( ) {
88
- event_queue. blocking_dispatch ( & mut simple_window) . unwrap ( ) ;
89
- }
90
-
91
87
// We don't draw immediately, the configure will notify us when to first draw.
92
88
93
89
loop {
@@ -469,16 +465,3 @@ impl ProvidesRegistryState for SimpleWindow {
469
465
}
470
466
registry_handlers ! [ OutputState , SeatState , ] ;
471
467
}
472
-
473
- impl Dispatch < wl_registry:: WlRegistry , GlobalListContents > for SimpleWindow {
474
- fn event (
475
- _state : & mut Self ,
476
- _registry : & wl_registry:: WlRegistry ,
477
- _event : wl_registry:: Event ,
478
- _data : & GlobalListContents ,
479
- _conn : & Connection ,
480
- _qh : & QueueHandle < Self > ,
481
- ) {
482
- // We don't need any other globals.
483
- }
484
- }
0 commit comments