feat(wm): allow valid attach_thread_input failures

This commit allows the Window.focus() fn to continue execution if
AttachThreadInput fails, as there are valid situations in which this
might fail, but the focusing of the window may/should still succeed.

fix #156
This commit is contained in:
LGUG2Z
2022-06-11 20:04:46 -07:00
parent 70be6f4ea4
commit 092e36b8b3
3 changed files with 41 additions and 28 deletions
+4 -3
View File
@@ -680,7 +680,7 @@ pub fn send_message(bytes: &[u8]) -> Result<()> {
let socket = socket.as_path();
let mut stream = UnixStream::connect(&socket)?;
Ok(stream.write_all(&*bytes)?)
Ok(stream.write_all(bytes)?)
}
#[allow(clippy::too_many_lines)]
@@ -720,8 +720,9 @@ fn main() -> Result<()> {
color_log.push("komorebi.log");
let file = TailedFile::new(File::open(color_log)?);
let locked = file.lock();
for line in locked.lines() {
println!("{}", line?);
#[allow(clippy::significant_drop_in_scrutinee)]
for line in locked.lines().flatten() {
println!("{}", line);
}
}
SubCommand::Focus(arg) => {