Don't wait for the request resize result
We'll need to find a workaround for this, but this makes resizing in the CLAP example host way too slow.
This commit is contained in:
parent
772c1ecfaf
commit
c568e5d3be
|
@ -30,7 +30,7 @@ impl<P: ClapPlugin> GuiContext for WrapperGuiContext<P> {
|
||||||
fn request_resize(&self) -> bool {
|
fn request_resize(&self) -> bool {
|
||||||
// Bitwig and the CLAP test host require this resize to be done from the main thread, so
|
// Bitwig and the CLAP test host require this resize to be done from the main thread, so
|
||||||
// we'll use a channel as a substitute for a promise here.
|
// we'll use a channel as a substitute for a promise here.
|
||||||
let (result_sender, result_receiver) = channel::bounded(1);
|
let (result_sender, _result_receiver) = channel::bounded(1);
|
||||||
if !self
|
if !self
|
||||||
.wrapper
|
.wrapper
|
||||||
.do_maybe_async(Task::RequestResize(result_sender))
|
.do_maybe_async(Task::RequestResize(result_sender))
|
||||||
|
@ -39,7 +39,13 @@ impl<P: ClapPlugin> GuiContext for WrapperGuiContext<P> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
result_receiver.recv().expect("Main thread died?")
|
// FIXME: Waiting for this can be very slow when this function gets called many times in
|
||||||
|
// rapid succession because the X11 GUI thread is not the same as the host's GUI
|
||||||
|
// thread and both Bitwig and CLAP will reject (or outright SIGABRT) if this gets
|
||||||
|
// called from any other thread
|
||||||
|
// result_receiver.recv().expect("Main thread died?")
|
||||||
|
|
||||||
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
// All of these functions are supposed to be called from the main thread, so we'll put some
|
// All of these functions are supposed to be called from the main thread, so we'll put some
|
||||||
|
|
|
@ -324,7 +324,7 @@ impl<P: ClapPlugin> MainThreadExecutor<Task> for Wrapper<P> {
|
||||||
};
|
};
|
||||||
|
|
||||||
// This channel acts as a promise, there will never be more than a single value
|
// This channel acts as a promise, there will never be more than a single value
|
||||||
// writen to it.
|
// writen to it, and if the other end got dropped then that's okay
|
||||||
let _ = result_sender.send(result);
|
let _ = result_sender.send(result);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue