1
0
Fork 0

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:
Robbert van der Helm 2022-03-28 00:50:08 +02:00
parent 772c1ecfaf
commit c568e5d3be
2 changed files with 9 additions and 3 deletions

View file

@ -30,7 +30,7 @@ impl<P: ClapPlugin> GuiContext for WrapperGuiContext<P> {
fn request_resize(&self) -> bool {
// 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.
let (result_sender, result_receiver) = channel::bounded(1);
let (result_sender, _result_receiver) = channel::bounded(1);
if !self
.wrapper
.do_maybe_async(Task::RequestResize(result_sender))
@ -39,7 +39,13 @@ impl<P: ClapPlugin> GuiContext for WrapperGuiContext<P> {
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

View file

@ -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
// writen to it.
// writen to it, and if the other end got dropped then that's okay
let _ = result_sender.send(result);
}
};