From 1ca87ced12609e4a5434be62d9a254c74db246fc Mon Sep 17 00:00:00 2001 From: Salem Yaslem Date: Sat, 13 Feb 2021 07:45:08 +0300 Subject: [PATCH] get default window area, remove debug process id --- src/area_capture.rs | 12 ++++++++---- src/ffmpeg_interface.rs | 1 - 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/area_capture.rs b/src/area_capture.rs index fddddb7..b2ecb0d 100644 --- a/src/area_capture.rs +++ b/src/area_capture.rs @@ -13,11 +13,15 @@ pub struct AreaCapture { impl AreaCapture { pub fn new() -> AreaCapture { + let coordinate = xwininfo_to_coordinate( + String::from_utf8(Command::new("xwininfo").arg("-root").output().unwrap().stdout).unwrap() + ); + AreaCapture { - x: 0, - y: 0, - width: 0, - height: 0, + x: coordinate.0, + y: coordinate.1, + width: coordinate.2, + height: coordinate.3, } } diff --git a/src/ffmpeg_interface.rs b/src/ffmpeg_interface.rs index 71a73c0..c14bec7 100644 --- a/src/ffmpeg_interface.rs +++ b/src/ffmpeg_interface.rs @@ -105,7 +105,6 @@ impl Ffmpeg { // start recording and return the process id self.process_id = Some(ffmpeg_command.spawn().unwrap().id()); - println!("{}", self.process_id.unwrap()); self.process_id.unwrap() }