Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions WebView2/Plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,6 @@ PLUGIN_EXPORT double Update(void* data)
{
measure->callbackResult = result;
}

// Trigger Rainmeter redraw after callback completes
if (measure->skin)
{
RmExecute(measure->skin, L"!UpdateMeter *");
RmExecute(measure->skin, L"!Redraw");
}
Copy link
Copy Markdown
Contributor Author

@RicardoTM05 RicardoTM05 Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, we need to avoid these unnecessary global updates.
This was causing CallJS to execute twice when called. See JSInteraction.ini, it's being logged twice. Removing this fixed it.

Note: The 1 update delay on the result on that demo skin may be unavoidable. Other ways to fix that may be investigated anyway. However, I find it unlikely due to the calls being async, so we may have to live with it (not a big deal anyways).

We could try doing it synchronously instead, unfortunately WebView2 doesn't offer a synchronous ExecuteScript function, however, someone offered a solution that we could try. Yep, we would risk blocking rainmeter for heavy scripts, but I think lua does block rainmeter too when scripts are heavy, so it may not be such a big deal. We would do it synchronously only for ExecuteScript calls by the way.

Here’s another, pretty long conversation about the same topic.

}
return S_OK;
}
Expand Down