fix(plugins): make sure to always render on first resize (#3693)
* fix(plugins): make sure to always render on first resize * style(fmt): rustfmt * fix tests
This commit is contained in:
parent
f36dccfe39
commit
53215e6228
3 changed files with 12 additions and 14 deletions
|
|
@ -693,11 +693,7 @@ impl<'a> PluginLoader<'a> {
|
||||||
.try_into()
|
.try_into()
|
||||||
.map_err(|e| anyhow!("Failed to serialize user configuration: {:?}", e))?;
|
.map_err(|e| anyhow!("Failed to serialize user configuration: {:?}", e))?;
|
||||||
let protobuf_bytes = protobuf_plugin_configuration.encode_to_vec();
|
let protobuf_bytes = protobuf_plugin_configuration.encode_to_vec();
|
||||||
wasi_write_object(
|
wasi_write_object(plugin.lock().unwrap().store.data(), &protobuf_bytes)
|
||||||
plugin.lock().unwrap().store.data(),
|
|
||||||
&protobuf_bytes,
|
|
||||||
// &self.plugin.userspace_configuration.inner(),
|
|
||||||
)
|
|
||||||
.with_context(err_context)?;
|
.with_context(err_context)?;
|
||||||
load_function
|
load_function
|
||||||
.call(&mut plugin.lock().unwrap().store, ())
|
.call(&mut plugin.lock().unwrap().store, ())
|
||||||
|
|
|
||||||
|
|
@ -695,7 +695,7 @@ pub fn load_new_plugin_from_hd() {
|
||||||
received_screen_instructions,
|
received_screen_instructions,
|
||||||
ScreenInstruction::PluginBytes,
|
ScreenInstruction::PluginBytes,
|
||||||
screen_receiver,
|
screen_receiver,
|
||||||
1,
|
2,
|
||||||
&PermissionType::ChangeApplicationState,
|
&PermissionType::ChangeApplicationState,
|
||||||
cache_path,
|
cache_path,
|
||||||
plugin_thread_sender,
|
plugin_thread_sender,
|
||||||
|
|
@ -775,7 +775,7 @@ pub fn load_new_plugin_with_plugin_alias() {
|
||||||
received_screen_instructions,
|
received_screen_instructions,
|
||||||
ScreenInstruction::PluginBytes,
|
ScreenInstruction::PluginBytes,
|
||||||
screen_receiver,
|
screen_receiver,
|
||||||
1,
|
2,
|
||||||
&PermissionType::ChangeApplicationState,
|
&PermissionType::ChangeApplicationState,
|
||||||
cache_path,
|
cache_path,
|
||||||
plugin_thread_sender,
|
plugin_thread_sender,
|
||||||
|
|
@ -851,7 +851,7 @@ pub fn plugin_workers() {
|
||||||
received_screen_instructions,
|
received_screen_instructions,
|
||||||
ScreenInstruction::PluginBytes,
|
ScreenInstruction::PluginBytes,
|
||||||
screen_receiver,
|
screen_receiver,
|
||||||
2,
|
3,
|
||||||
&PermissionType::ChangeApplicationState,
|
&PermissionType::ChangeApplicationState,
|
||||||
cache_path,
|
cache_path,
|
||||||
plugin_thread_sender,
|
plugin_thread_sender,
|
||||||
|
|
@ -931,7 +931,7 @@ pub fn plugin_workers_persist_state() {
|
||||||
received_screen_instructions,
|
received_screen_instructions,
|
||||||
ScreenInstruction::PluginBytes,
|
ScreenInstruction::PluginBytes,
|
||||||
screen_receiver,
|
screen_receiver,
|
||||||
4,
|
5,
|
||||||
&PermissionType::ChangeApplicationState,
|
&PermissionType::ChangeApplicationState,
|
||||||
cache_path,
|
cache_path,
|
||||||
plugin_thread_sender,
|
plugin_thread_sender,
|
||||||
|
|
@ -5952,7 +5952,7 @@ pub fn unblock_input_plugin_command() {
|
||||||
received_screen_instructions,
|
received_screen_instructions,
|
||||||
ScreenInstruction::PluginBytes,
|
ScreenInstruction::PluginBytes,
|
||||||
screen_receiver,
|
screen_receiver,
|
||||||
1,
|
2,
|
||||||
&PermissionType::ReadCliPipes,
|
&PermissionType::ReadCliPipes,
|
||||||
cache_path,
|
cache_path,
|
||||||
plugin_thread_sender,
|
plugin_thread_sender,
|
||||||
|
|
@ -6034,7 +6034,7 @@ pub fn block_input_plugin_command() {
|
||||||
received_screen_instructions,
|
received_screen_instructions,
|
||||||
ScreenInstruction::PluginBytes,
|
ScreenInstruction::PluginBytes,
|
||||||
screen_receiver,
|
screen_receiver,
|
||||||
1,
|
2,
|
||||||
&PermissionType::ReadCliPipes,
|
&PermissionType::ReadCliPipes,
|
||||||
cache_path,
|
cache_path,
|
||||||
plugin_thread_sender,
|
plugin_thread_sender,
|
||||||
|
|
@ -6207,7 +6207,7 @@ pub fn pipe_message_to_plugin_plugin_command() {
|
||||||
received_screen_instructions,
|
received_screen_instructions,
|
||||||
ScreenInstruction::PluginBytes,
|
ScreenInstruction::PluginBytes,
|
||||||
screen_receiver,
|
screen_receiver,
|
||||||
2,
|
3,
|
||||||
&PermissionType::ReadCliPipes,
|
&PermissionType::ReadCliPipes,
|
||||||
cache_path,
|
cache_path,
|
||||||
plugin_thread_sender,
|
plugin_thread_sender,
|
||||||
|
|
|
||||||
|
|
@ -615,7 +615,9 @@ impl WasmBridge {
|
||||||
running_plugin.rows = new_rows;
|
running_plugin.rows = new_rows;
|
||||||
running_plugin.columns = new_columns;
|
running_plugin.columns = new_columns;
|
||||||
|
|
||||||
if old_rows != new_rows || old_columns != new_columns {
|
// in the below conditional, we check if event_id == 0 so that we'll
|
||||||
|
// make sure to always render on the first resize event
|
||||||
|
if old_rows != new_rows || old_columns != new_columns || event_id == 0 {
|
||||||
let rendered_bytes = running_plugin
|
let rendered_bytes = running_plugin
|
||||||
.instance
|
.instance
|
||||||
.clone()
|
.clone()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue