fix build linux

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow
2023-10-18 08:07:00 +08:00
parent c4f09b5598
commit a32e740242
5 changed files with 27 additions and 18 deletions

View File

@@ -84,7 +84,6 @@ impl TraitCapturer for CapturerPtr {
struct CapDisplayInfo {
rects: Vec<((i32, i32), usize, usize)>,
displays: Vec<DisplayInfo>,
num: usize,
primary: usize,
current: usize,
capturer: CapturerPtr,
@@ -146,7 +145,8 @@ pub(super) async fn check_init() -> ResultType<()> {
let num = all.len();
let primary = super::display_service::get_primary_2(&all);
let current = primary;
let mut displays = super::display_service::to_display_info(&all);
super::display_service::check_update_displays(&all);
let mut displays = super::display_service::get_sync_displays();
for display in displays.iter_mut() {
display.cursor_embedded = is_cursor_embedded();
}
@@ -173,12 +173,15 @@ pub(super) async fn check_init() -> ResultType<()> {
Some(result) if !result.is_empty() => {
let resolution: Vec<&str> = result.split(" ").collect();
let w: i32 = resolution[0].parse().unwrap_or(origin.0 + width as i32);
let h: i32 = resolution[2].trim_end_matches(",").parse().unwrap_or(origin.1 + height as i32);
let h: i32 = resolution[2]
.trim_end_matches(",")
.parse()
.unwrap_or(origin.1 + height as i32);
(w, h)
}
_ => (origin.0 + width as i32, origin.1 + height as i32)
_ => (origin.0 + width as i32, origin.1 + height as i32),
};
minx = 0;
maxx = max_width;
miny = 0;
@@ -191,7 +194,6 @@ pub(super) async fn check_init() -> ResultType<()> {
let cap_display_info = Box::into_raw(Box::new(CapDisplayInfo {
rects,
displays,
num,
primary,
current,
capturer,
@@ -273,7 +275,6 @@ pub(super) fn get_capturer() -> ResultType<super::video_service::CapturerInfo> {
origin: rect.0,
width: rect.1,
height: rect.2,
ndisplay: cap_display_info.num,
current: cap_display_info.current,
privacy_mode_id: 0,
_capturer_privacy_mode_id: 0,