Skip to content

Commit 45a2ea5

Browse files
authored
Merge pull request #319 from i509VCB/pointer_theme_window
fix pointer_theme_window
2 parents 5c55b98 + c7d6ddb commit 45a2ea5

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

examples/pointer_theme_window.rs

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ use smithay_client_toolkit::{
2222
},
2323
};
2424
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,
2828
};
2929

3030
fn main() {
@@ -34,9 +34,9 @@ fn main() {
3434

3535
let (globals, mut event_queue) = registry_queue_init(&conn).unwrap();
3636
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);
4040
let compositor_state =
4141
CompositorState::bind(&globals, &qh).expect("wl_compositor not available");
4242
let shm_state = ShmState::bind(&globals, &qh).expect("wl_shm not available");
@@ -84,10 +84,6 @@ fn main() {
8484
set_cursor: false,
8585
};
8686

87-
while !simple_window.registry_state.ready() {
88-
event_queue.blocking_dispatch(&mut simple_window).unwrap();
89-
}
90-
9187
// We don't draw immediately, the configure will notify us when to first draw.
9288

9389
loop {
@@ -469,16 +465,3 @@ impl ProvidesRegistryState for SimpleWindow {
469465
}
470466
registry_handlers![OutputState, SeatState,];
471467
}
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

Comments
 (0)