mirror of
https://github.com/rustdesk/qemu-display.git
synced 2025-07-01 15:25:29 +00:00
qemu-rdw: connect to default org.qemu instance
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
91a8549b70
commit
e7b1548361
@ -4,7 +4,8 @@ use glib::MainContext;
|
|||||||
use gtk::{gio, glib, prelude::*};
|
use gtk::{gio, glib, prelude::*};
|
||||||
use qemu_display::{util, Chardev, Console, Display};
|
use qemu_display::{util, Chardev, Console, Display};
|
||||||
use rdw::gtk;
|
use rdw::gtk;
|
||||||
use std::{cell::RefCell, sync::Arc};
|
use std::{cell::RefCell, convert::TryFrom, sync::Arc};
|
||||||
|
use zbus::names::BusName;
|
||||||
|
|
||||||
mod audio;
|
mod audio;
|
||||||
mod clipboard;
|
mod clipboard;
|
||||||
@ -66,23 +67,26 @@ async fn display_from_opt(opt: Arc<RefCell<AppOptions>>) -> Option<Display<'stat
|
|||||||
}
|
}
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let dest = {
|
let dest = if opt.borrow().vm_name.is_some() {
|
||||||
let name = opt.borrow().vm_name.clone();
|
let name = opt.borrow().vm_name.clone();
|
||||||
let wait = opt.borrow().wait;
|
let wait = opt.borrow().wait;
|
||||||
|
|
||||||
Display::lookup(&conn, wait, name.as_deref()).await.unwrap()
|
Display::lookup(&conn, wait, name.as_deref())
|
||||||
|
.await
|
||||||
|
.unwrap()
|
||||||
|
.map(Into::into)
|
||||||
|
} else {
|
||||||
|
BusName::try_from("org.qemu").ok()
|
||||||
};
|
};
|
||||||
|
|
||||||
Some(
|
Display::new(
|
||||||
Display::new(
|
&conn,
|
||||||
&conn,
|
dest,
|
||||||
dest,
|
#[cfg(windows)]
|
||||||
#[cfg(windows)]
|
unimplemented!(),
|
||||||
unimplemented!(),
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
.unwrap(),
|
|
||||||
)
|
)
|
||||||
|
.await
|
||||||
|
.ok()
|
||||||
}
|
}
|
||||||
|
|
||||||
impl App {
|
impl App {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user