-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intermitent blank output when using '#![windows_subsystem = "windows"]' on Windows 10 #28
Comments
I too experienced this on Windows; a workaround I used was to wrap the
I recall when this happened (which seemed pretty inconsistent), I'd need to wait 5-15ms before getting a non-solid-black buffer, which sounded suspiciously like I had to wait for the "next frame" @ 60hz. |
Thanks for the workaround, it's helped and gives a consistent output. Odd the output is blank still somtimes to need this as I was already waiting on match error for another frame. |
@McSpidey @Nebual any further progress on figuring this out? I am experiencing this and it occurs if I shake the mouse a bunch, every frame is all 0s and WouldBlock does not show, so it seems to be interrupt-related. The section here where Buffer length: is printed out 3 times in a row (without blocking for the next frame) occurred while the mouse was being shaken. When the mouse stopped moving it resumed normal behavior. This behavior is also reproducible only when the mouse is moved on the screen being captured, if the mouse is moving on the other screen, no blank frames are captured. |
Sorry, I haven't revisited this. That's a good find re mouse interrupts though. |
Hi, I am currently facing this issue working with the example code. This is what I have currently.
The blank output occurs for me whenever the WouldBlock error is returned, so I assume this is a problem with calling capture.frame() inside a loop. Trying to learn more about lifetimes to remedy this, any help would be appreciated . |
Was just testing this rad library with some sample code and noticed it's ultra reliable when called in a standard console mode, but I wanted the console not in the screenshot so tried wrapping it #![windows_subsystem = "windows"], now 4 out of 5 attempts to call this produces a blank output.
Testing on Windows 10.
`//#![windows_subsystem = "windows"]
extern crate repng;
extern crate scrap;
use scrap::{Capturer, Display};
use std::io::ErrorKind::WouldBlock;
use std::fs::File;
use std::thread;
use std::time::Duration;
fn main() {
let one_second = Duration::new(1, 0);
let one_frame = one_second / 60;
}`
The text was updated successfully, but these errors were encountered: