mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Fix pancurses for windows
This commit is contained in:
parent
6135b0df79
commit
1f1e238d2e
@ -317,6 +317,7 @@ impl Backend {
|
||||
pairs: RefCell::new(HashMap::new()),
|
||||
window: Arc::new(window),
|
||||
needs_resize: Arc::new(AtomicBool::new(false)),
|
||||
#[cfg(unix)]
|
||||
signals,
|
||||
};
|
||||
|
||||
@ -458,8 +459,10 @@ impl backend::Backend for Backend {
|
||||
|
||||
let resize_running = Arc::clone(&running);
|
||||
let resize_sender = event_sink.clone();
|
||||
let signals = self.signals.take().unwrap();
|
||||
|
||||
#[cfg(unix)]
|
||||
{
|
||||
let signals = self.signals.take().unwrap();
|
||||
thread::spawn(move || {
|
||||
// This thread will listen to SIGWINCH events and report them.
|
||||
while resize_running.load(Ordering::Relaxed) {
|
||||
@ -474,6 +477,11 @@ impl backend::Backend for Backend {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// On windows we just forget the sender, so the receiver blocks forever.
|
||||
#[cfg(not(unix))]
|
||||
::std::mem::forget(resize_sender);
|
||||
|
||||
let mut input_parser =
|
||||
InputParser::new(event_sink, Arc::clone(&self.window));
|
||||
|
Loading…
Reference in New Issue
Block a user