Skip to content

Commit

Permalink
chore: show clipboard open failure every time
Browse files Browse the repository at this point in the history
  • Loading branch information
anatawa12 committed Sep 1, 2023
1 parent 7aed717 commit 562f238
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/os/win.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::ffi::c_void;
use log::error;
use log::*;
use once_cell::sync::Lazy;
use std::mem::size_of;
use std::path::{Path, PathBuf};
Expand Down Expand Up @@ -56,10 +56,12 @@ pub fn enter_enter() {
}

fn open_clipboard(hwnd: &winsafe::HWND) -> winsafe::SysResult<winsafe::guard::CloseClipboardGuard> {
for _ in 0..9 {
for i in 0..9 {
match hwnd.OpenClipboard() {
Ok(guard) => return Ok(guard),
Err(e) => (),
Err(e) => {
info!("open failure #{i}: {e:?}");
},
};
sleep(Duration::from_millis(100));
}
Expand Down

0 comments on commit 562f238

Please sign in to comment.