diff --git a/Cargo.toml b/Cargo.toml index a68fd44..52587a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,8 @@ license = "MIT" keywords = ["clipboard", "wayland"] [dependencies] -sctk = { package = "smithay-client-toolkit", version = "0.10", default-features = false } +sctk = { package = "smithay-client-toolkit", version = "0.11", default-features = false } wayland-client = { version = "0.27", features = ["dlopen"] } [dev-dependencies] -sctk = { package = "smithay-client-toolkit", version = "0.10"} +sctk = { package = "smithay-client-toolkit", version = "0.11"} diff --git a/examples/clipboard.rs b/examples/clipboard.rs index e8e0caf..a3abfca 100644 --- a/examples/clipboard.rs +++ b/examples/clipboard.rs @@ -41,27 +41,32 @@ fn main() { let mut dimentions = (320u32, 240u32); // Create surface - let surface = env.create_surface(); + let surface = env.create_surface().detach(); // Create window let mut window = env - .create_window::(surface, dimentions, move |event, mut dispatch_data| { - // Get our dispath data - let dispatch_data = dispatch_data.get::().unwrap(); + .create_window::( + surface, + None, + dimentions, + move |event, mut dispatch_data| { + // Get our dispath data + let dispatch_data = dispatch_data.get::().unwrap(); - // Keep last event in priority order : Close > Configure > Refresh - let should_replace_event = match (&event, &dispatch_data.pending_frame_event) { - (_, &None) - | (_, &Some(WindowEvent::Refresh)) - | (&WindowEvent::Configure { .. }, &Some(WindowEvent::Configure { .. })) - | (&WindowEvent::Close, _) => true, - _ => false, - }; + // Keep last event in priority order : Close > Configure > Refresh + let should_replace_event = match (&event, &dispatch_data.pending_frame_event) { + (_, &None) + | (_, &Some(WindowEvent::Refresh)) + | (&WindowEvent::Configure { .. }, &Some(WindowEvent::Configure { .. })) + | (&WindowEvent::Close, _) => true, + _ => false, + }; - if should_replace_event { - dispatch_data.pending_frame_event = Some(event); - } - }) + if should_replace_event { + dispatch_data.pending_frame_event = Some(event); + } + }, + ) .expect("failed to create a window."); // Set title and app id