Bump gtk/glib/rdw deps

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2022-01-18 23:08:46 +04:00
parent 2c007d8c4c
commit fc56b9fcb8
7 changed files with 34 additions and 40 deletions

View File

@ -12,6 +12,4 @@ default-members = ["qemu-rdw"]
[patch.crates-io]
vnc = { git = "https://github.com/elmarco/rust-vnc", branch = "server" }
zbus = { git = "https://gitlab.freedesktop.org/dbus/zbus.git" }
zvariant = { git = "https://gitlab.freedesktop.org/dbus/zbus.git" }
rdw4 = { git = "https://gitlab.gnome.org/malureau/rdw.git" }

View File

@ -9,7 +9,7 @@ edition = "2018"
[dependencies]
log = "0.4"
derivative = "2.2.0"
zbus = { version = "2.0.0-beta.7", features = ["xml"] }
zbus = { version = "2.0", features = ["xml"] }
zvariant = { version = "3.0", features = ["serde_bytes"] }
libc = "0.2.86"
enumflags2 = { version = "0.7", features = ["serde"] }

View File

@ -10,10 +10,10 @@ edition = "2018"
log = "0.4"
pretty_env_logger = "0.4"
once_cell = "1.5"
zbus = { version = "2.0.0-beta.7" }
zbus = { version = "2.0" }
qemu-display = { path = "../qemu-display" }
keycodemap = { path = "../keycodemap" }
rdw = { package = "rdw4", version = "0.1.0", features = ["bindings"] }
futures-util = "0.3.13"
futures = "0.3.13"
async-trait = "0.1.48"
rdw = { package = "rdw4", version = "0.1", features = ["bindings"] }
futures-util = "0.3"
futures = "0.3"
async-trait = "0.1"

View File

@ -67,7 +67,7 @@ impl ClipboardHandler for InnerHandler {
match p.request(selection, &[&mime]).await {
Ok((_, data)) => {
let bytes = glib::Bytes::from(&data);
stream.write_bytes_async_future(&bytes, prio).await.map(|_| ())
stream.write_bytes_future(&bytes, prio).await.map(|_| ())
}
Err(e) => {
let err = format!("failed to request clipboard data: {}", e);
@ -88,7 +88,7 @@ impl ClipboardHandler for InnerHandler {
async fn release(&mut self, selection: ClipboardSelection) {
if let Some((clipboard, _)) = clipboard_from_selection(selection) {
// TODO: track if the outside/app changed the clipboard
if let Err(e) = clipboard.set_content(gdk::NONE_CONTENT_PROVIDER) {
if let Err(e) = clipboard.set_content(gdk::ContentProvider::NONE) {
log::warn!("Failed to release clipboard: {}", e);
}
}
@ -104,15 +104,13 @@ impl ClipboardHandler for InnerHandler {
glib::MainContext::default().spawn_local(async move {
let res = if let Some((clipboard, _)) = clipboard_from_selection(selection) {
let m: Vec<_> = mimes.iter().map(|s| s.as_str()).collect();
let res = clipboard
.read_async_future(&m, glib::Priority::default())
.await;
let res = clipboard.read_future(&m, glib::Priority::default()).await;
log::debug!("clipboard-read: {}", res.is_ok());
match res {
Ok((stream, mime)) => {
let out = gio::MemoryOutputStream::new_resizable();
let res = out
.splice_async_future(
.splice_future(
&stream,
gio::OutputStreamSpliceFlags::CLOSE_SOURCE
| gio::OutputStreamSpliceFlags::CLOSE_TARGET,
@ -201,22 +199,21 @@ fn watch_clipboard(
return;
}
if let Some(formats) = clipboard.formats() {
let types = formats.mime_types();
log::debug!(">clipboard-changed({:?}): {:?}", selection, types);
let proxy = proxy.clone();
let serials = serials.clone();
glib::MainContext::default().spawn_local(async move {
if types.is_empty() {
let _ = proxy.release(selection).await;
} else {
let mimes: Vec<_> = types.iter().map(|s| s.as_str()).collect();
let ser = serials[idx].load(Ordering::SeqCst);
let _ = proxy.grab(selection, ser, &mimes).await;
serials[idx].store(ser + 1, Ordering::SeqCst);
}
});
}
let formats = clipboard.formats();
let types = formats.mime_types();
log::debug!(">clipboard-changed({:?}): {:?}", selection, types);
let proxy = proxy.clone();
let serials = serials.clone();
glib::MainContext::default().spawn_local(async move {
if types.is_empty() {
let _ = proxy.release(selection).await;
} else {
let mimes: Vec<_> = types.iter().map(|s| s.as_str()).collect();
let ser = serials[idx].load(Ordering::SeqCst);
let _ = proxy.grab(selection, ser, &mimes).await;
serials[idx].store(ser + 1, Ordering::SeqCst);
}
});
});
Some(id)
}

View File

@ -25,7 +25,7 @@ impl Handler {
for pos in pos..pos + add {
let item = model.item(pos).unwrap();
if let Some(dev) = item.downcast_ref::<rdw::UsbDevice>().unwrap().device() {
item.set_property("active", usbredir.is_device_connected(&dev).await).unwrap();
item.set_property("active", usbredir.is_device_connected(&dev).await);
}
}
}));
@ -41,12 +41,12 @@ impl Handler {
let usbredir = usbredir.clone();
MainContext::default().spawn_local(clone!(@weak item, @weak widget => async move {
match usbredir.set_device_state(&device, state).await {
Ok(active) => item.set_property("active", active).unwrap(),
Ok(active) => item.set_property("active", active),
Err(e) => {
if state {
item.set_property("active", false).unwrap();
item.set_property("active", false);
}
widget.emit_by_name("show-error", &[&e.to_string()]).unwrap();
widget.emit_by_name::<()>("show-error", &[&e.to_string()]);
},
}
}));
@ -56,11 +56,10 @@ impl Handler {
MainContext::default().spawn_local(clone!(@weak widget => async move {
use futures::stream::StreamExt; // for `next`
widget
.set_property("free-channels", usbredir.n_free_channels().await)
.unwrap();
.set_property("free-channels", usbredir.n_free_channels().await);
let mut n = usbredir.receive_n_free_channels().await;
while let Some(n) = n.next().await {
widget.set_property("free-channels", n).unwrap();
widget.set_property("free-channels", n);
}
}));

View File

@ -7,10 +7,10 @@ edition = "2018"
log = "0.4"
pretty_env_logger = "0.4"
once_cell = "1.5"
zbus = { version = "2.0.0-beta.7" }
zbus = { version = "2.0" }
qemu-display = { path = "../qemu-display" }
futures = "0.3.13"
[dependencies.vte]
package = "vte4"
version = "0.0.1"
version = "0.1"

View File

@ -45,7 +45,7 @@ fn main() {
let mut read = istream.into_async_read().unwrap();
term.connect_commit(move |_, text, _| {
let _res = ostream.write(text.as_bytes(), gio::NONE_CANCELLABLE); // TODO cancellable and error
let _res = ostream.write(text.as_bytes(), gio::Cancellable::NONE); // TODO cancellable and error
});
loop {