fix build without wayland feature
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
a29203c9fe
commit
f3d10dd420
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -319,9 +319,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitvec"
|
name = "bitvec"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1489fcb93a5bb47da0462ca93ad252ad6af2145cce58d10d46a83931ba9f016b"
|
checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"funty",
|
"funty",
|
||||||
"radium",
|
"radium",
|
||||||
@ -2212,7 +2212,7 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "hwcodec"
|
name = "hwcodec"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/21pages/hwcodec#890204e0703a3d361fc7a45f035fe75c0575bb1d"
|
source = "git+https://github.com/21pages/hwcodec#91d1cd327c88490f917457072aeef0676ddb2be7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bindgen",
|
"bindgen",
|
||||||
"cc",
|
"cc",
|
||||||
|
@ -54,14 +54,9 @@ pub enum Display {
|
|||||||
WAYLAND(wayland::Display),
|
WAYLAND(wayland::Display),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn is_x11() -> bool {
|
|
||||||
"x11" == hbb_common::platform::linux::get_display_server()
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Display {
|
impl Display {
|
||||||
pub fn primary() -> io::Result<Display> {
|
pub fn primary() -> io::Result<Display> {
|
||||||
Ok(if is_x11() {
|
Ok(if super::is_x11() {
|
||||||
Display::X11(x11::Display::primary()?)
|
Display::X11(x11::Display::primary()?)
|
||||||
} else {
|
} else {
|
||||||
Display::WAYLAND(wayland::Display::primary()?)
|
Display::WAYLAND(wayland::Display::primary()?)
|
||||||
@ -69,7 +64,7 @@ impl Display {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn all() -> io::Result<Vec<Display>> {
|
pub fn all() -> io::Result<Vec<Display>> {
|
||||||
Ok(if is_x11() {
|
Ok(if super::is_x11() {
|
||||||
x11::Display::all()?
|
x11::Display::all()?
|
||||||
.drain(..)
|
.drain(..)
|
||||||
.map(|x| Display::X11(x))
|
.map(|x| Display::X11(x))
|
||||||
|
@ -59,3 +59,9 @@ pub trait TraitCapturer {
|
|||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
fn set_gdi(&mut self) -> bool;
|
fn set_gdi(&mut self) -> bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(x11)]
|
||||||
|
#[inline]
|
||||||
|
pub fn is_x11() -> bool {
|
||||||
|
"x11" == hbb_common::platform::linux::get_display_server()
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user