Skip to content

Commit

Permalink
Fixed windows regressions.
Browse files Browse the repository at this point in the history
  • Loading branch information
5cript committed Oct 22, 2023
1 parent b72400f commit 212c2e2
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions nui/src/nui/backend/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,11 @@ namespace Nui
auto nativeWebView = WEBKIT_WEB_VIEW(getNativeWebView());
auto* webContext = webkit_web_view_get_context(nativeWebView);
webkit_web_context_register_uri_scheme(
webContext, linuxImpl->schemes.back().c_str(), &uriSchemeRequestCallback, entry.get(), &uriSchemeDestroyNotify);
webContext,
linuxImpl->schemes.back().c_str(),
&uriSchemeRequestCallback,
entry.get(),
&uriSchemeDestroyNotify);
#endif
}
//---------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -381,17 +385,18 @@ namespace Nui
void Window::run()
{
#ifdef _WIN32
auto* winImpl = static_cast<WindowsImplementation*>(impl_.get());
MSG msg;
BOOL res;
while ((res = GetMessage(&msg, nullptr, 0, 0)) != -1)
{
{
std::scoped_lock lock{impl_->viewGuard};
if (!impl_->toProcessOnWindowThread.empty())
std::scoped_lock lock{winImpl->viewGuard};
if (!winImpl->toProcessOnWindowThread.empty())
{
for (auto const& func : impl_->toProcessOnWindowThread)
for (auto const& func : winImpl->toProcessOnWindowThread)
func();
impl_->toProcessOnWindowThread.clear();
winImpl->toProcessOnWindowThread.clear();
}
}
if (msg.message == wakeUpMessage)
Expand Down Expand Up @@ -559,7 +564,7 @@ namespace Nui
}
else
{
winImpl->toProcessOnWindowThread.push_back([this, js]() {
winImpl->toProcessOnWindowThread.push_back([js, winImpl]() {
winImpl->view.eval(js);
});
PostThreadMessage(winImpl->windowThreadId, wakeUpMessage, 0, 0);
Expand Down

0 comments on commit 212c2e2

Please sign in to comment.