Update SCTK to 0.12
This commit is contained in:
parent
12b9edc4f3
commit
eef2ca9f2e
4 changed files with 11 additions and 12 deletions
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
- Updated smithay-client-toolkit to 0.12
|
||||||
|
|
||||||
## 0.5.2 -- 2020-08-30
|
## 0.5.2 -- 2020-08-30
|
||||||
|
|
||||||
- Fixed clipboard crashing, when seat has neither keyboard nor pointer focus
|
- Fixed clipboard crashing, when seat has neither keyboard nor pointer focus
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ license = "MIT"
|
||||||
keywords = ["clipboard", "wayland"]
|
keywords = ["clipboard", "wayland"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
sctk = { package = "smithay-client-toolkit", version = "0.11", default-features = false }
|
sctk = { package = "smithay-client-toolkit", version = "0.12", default-features = false }
|
||||||
wayland-client = { version = "0.27", features = ["dlopen"] }
|
wayland-client = { version = "0.28", features = ["dlopen"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
sctk = { package = "smithay-client-toolkit", version = "0.11"}
|
sctk = { package = "smithay-client-toolkit", version = "0.12"}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ impl DispatchData {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Setup default desktop environment
|
// 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.");
|
.expect("unable to connect to a Wayland compositor.");
|
||||||
|
|
||||||
// Create event loop
|
// Create event loop
|
||||||
|
|
|
||||||
|
|
@ -66,14 +66,11 @@ fn worker_impl(display: Display, request_rx: Receiver<Command>, reply_tx: Sender
|
||||||
let mut queue = display.create_event_queue();
|
let mut queue = display.create_event_queue();
|
||||||
let display_proxy = display.attach(queue.token());
|
let display_proxy = display.attach(queue.token());
|
||||||
|
|
||||||
let env = Environment::init(&display_proxy, SmithayClipboard::new());
|
let env = match Environment::new(&display_proxy, &mut queue, SmithayClipboard::new()) {
|
||||||
let req = queue.sync_roundtrip(&mut (), |_, _, _| unreachable!());
|
Ok(env) => env,
|
||||||
let req = req.and_then(|_| queue.sync_roundtrip(&mut (), |_, _, _| unreachable!()));
|
// We shouldn't crash the application if we've failed to create environment.
|
||||||
|
Err(_) => return,
|
||||||
// We shouldn't crash the application if we've failed to dispatch.
|
};
|
||||||
if req.is_err() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get data device manager.
|
// Get data device manager.
|
||||||
let data_device_manager = env.get_global::<WlDataDeviceManager>();
|
let data_device_manager = env.get_global::<WlDataDeviceManager>();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue