Update SCTK to 0.12

This commit is contained in:
Kirill Chibisov 2020-09-30 18:05:24 +03:00
parent 12b9edc4f3
commit eef2ca9f2e
4 changed files with 11 additions and 12 deletions

View file

@ -2,6 +2,8 @@
## Unreleased
- Updated smithay-client-toolkit to 0.12
## 0.5.2 -- 2020-08-30
- Fixed clipboard crashing, when seat has neither keyboard nor pointer focus

View file

@ -10,8 +10,8 @@ license = "MIT"
keywords = ["clipboard", "wayland"]
[dependencies]
sctk = { package = "smithay-client-toolkit", version = "0.11", default-features = false }
wayland-client = { version = "0.27", features = ["dlopen"] }
sctk = { package = "smithay-client-toolkit", version = "0.12", default-features = false }
wayland-client = { version = "0.28", features = ["dlopen"] }
[dev-dependencies]
sctk = { package = "smithay-client-toolkit", version = "0.11"}
sctk = { package = "smithay-client-toolkit", version = "0.12"}

View file

@ -31,7 +31,7 @@ impl DispatchData {
fn main() {
// Setup default desktop environment
let (env, display, queue) = sctk::init_default_environment!(ClipboardExample, desktop)
let (env, display, queue) = sctk::new_default_environment!(ClipboardExample, desktop)
.expect("unable to connect to a Wayland compositor.");
// Create event loop

View file

@ -66,14 +66,11 @@ fn worker_impl(display: Display, request_rx: Receiver<Command>, reply_tx: Sender
let mut queue = display.create_event_queue();
let display_proxy = display.attach(queue.token());
let env = Environment::init(&display_proxy, SmithayClipboard::new());
let req = queue.sync_roundtrip(&mut (), |_, _, _| unreachable!());
let req = req.and_then(|_| queue.sync_roundtrip(&mut (), |_, _, _| unreachable!()));
// We shouldn't crash the application if we've failed to dispatch.
if req.is_err() {
return;
}
let env = match Environment::new(&display_proxy, &mut queue, SmithayClipboard::new()) {
Ok(env) => env,
// We shouldn't crash the application if we've failed to create environment.
Err(_) => return,
};
// Get data device manager.
let data_device_manager = env.get_global::<WlDataDeviceManager>();