vcl/qt5/QtFrame.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 46cadd6b03294202ac27f1c3587d66e08e0b797e
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Tue Feb 18 13:43:39 2025 +0100
Commit:     Stephan Bergmann <[email protected]>
CommitDate: Tue Feb 18 16:01:25 2025 +0100

    Some more need for EmscriptenLightweightRunInMainThread
    
    This code can be reached e.g. when
    
<https://github.com/allotropia/zetajs/blob/main/examples/simple-examples/rainbow_writer.js>
    is executed not on the main browser thread,
    
    > Aborted(Assertion failed: invalid handle: 14)
    > threadPrintErr        @       soffice.js:900
    > abort @       soffice.js:1202
    > assert        @       soffice.js:658
    > toValue       @       soffice.js:7308
    > __emval_call_method   @       soffice.js:9856
    > $QWasmWindow::frameMargins() const    @       soffice.wasm:0x83de160
    > $QWasmWindow::setGeometry(QRect const&)       @       
soffice.wasm:0x83dd1a6
    > $QWindow::setGeometry(QRect const&)   @       soffice.wasm:0x7cfd8a1
    > $QWindow::setPosition(int, int)       @       soffice.wasm:0x7cff114
    > $QWidgetPrivate::setGeometry_sys(int, int, int, int, bool)    @       
soffice.wasm:0x8041fd9
    > $QWidget::move(QPoint const&) @       soffice.wasm:0x80419ab
    > $QtFrame::SetScreenNumber(unsigned int)       @       
soffice.wasm:0x65b5c61
    > $QtFrame::ShowFullScreen(bool, long)  @       soffice.wasm:0x65b418f
    > $non-virtual thunk to QtFrame::ShowFullScreen(bool, long)     @       
soffice.wasm:0x65b4231
    > $WorkWindow::ShowFullScreenMode(bool) @       soffice.wasm:0x1553b3f
    > $VCLXTopWindow::setFullScreen(unsigned char)  @       
soffice.wasm:0x123f6b4
    > $non-virtual thunk to VCLXTopWindow::setFullScreen(unsigned char)     @   
    soffice.wasm:0x123f727
    > $callVirtualFunction_vii      @       soffice.wasm:0x659ab75
    > $callVirtualFunction(std::__2::basic_string_view<char, 
std::__2::char_traits<char>>, unsigned long, unsigned long long const*, void*) 
@       soffice.wasm:0x6526a40
    > $(anonymous 
namespace)::call(bridges::cpp_uno::shared::UnoInterfaceProxy*, 
bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, long, 
_typelib_MethodParameter*, void*, void**, _uno_Any**)      @       
soffice.wasm:0x651f2ea
    > $unoInterfaceProxyDispatch    @       soffice.wasm:0x651e742
    > $stoc_corefl::(anonymous 
namespace)::IdlAttributeFieldImpl::set(com::sun::star::uno::Any&, 
com::sun::star::uno::Any const&)   @       soffice.wasm:0x64ec9ec
    > $non-virtual thunk to stoc_corefl::(anonymous 
namespace)::IdlAttributeFieldImpl::set(com::sun::star::uno::Any&, 
com::sun::star::uno::Any const&)      @       soffice.wasm:0x64ecb76
    > $(anonymous 
namespace)::ImplIntrospectionAccess::setPropertyValue(rtl::OUString const&, 
com::sun::star::uno::Any const&)      @       soffice.wasm:0x64a4ec4
    > $non-virtual thunk to (anonymous 
namespace)::ImplIntrospectionAccess::setPropertyValue(rtl::OUString const&, 
com::sun::star::uno::Any const&) @       soffice.wasm:0x64a8b18
    > $stoc_inv::(anonymous namespace)::Invocation_Impl::setValue(rtl::OUString 
const&, com::sun::star::uno::Any const&)    @       soffice.wasm:0x64b3e81
    > $non-virtual thunk to stoc_inv::(anonymous 
namespace)::Invocation_Impl::setValue(rtl::OUString const&, 
com::sun::star::uno::Any const&)       @       soffice.wasm:0x64b66bc
    > 
$emscripten::internal::MethodInvoker<emscripten::internal::rvp::default_tag, 
void (com::sun::star::script::XInvocation::*)(rtl::OUString const&, 
com::sun::star::uno::Any const&), void, com::sun::star::script::XInvocation*, 
rtl::OUString const&, com::sun::star::uno::Any const&>::invoke(void 
(com::sun::star::script::XInvocation::* const&)(rtl::OUString const&, 
com::sun::star::uno::Any const&), com::sun::star::script::XInvocation*, 
rtl::OUString*, com::sun::star::uno::Any*)   @       soffice.wasm:0x48dbe6
    > uno_Type_com$sun$star$script$XInvocation.setValue     @       VM1145:10
    > invokeSetter  @       zeta.js:444
    > Object.defineProperty.set     @       zeta.js:485
    > (anonymous)   @       rainbow_writer.js:36
    > setInterval
    > demo  @       rainbow_writer.js:36
    
    Change-Id: I9380e2aba1d87cef6ce858b7755bdd3f01484021
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181832
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>

diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index e7f12183bbc5..ff20afa94363 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -1333,7 +1333,8 @@ void QtFrame::SetScreenNumber(unsigned int nScreen)
 
     // setScreen by itself has no effect, explicitly move the widget to
     // the new screen
-    asChild()->move(screenGeo.topLeft());
+    GetQtInstance().EmscriptenLightweightRunInMainThread(
+        [ child = asChild(), topLeft = screenGeo.topLeft() ] { 
child->move(topLeft); });
 }
 
 void QtFrame::SetApplicationID(const OUString& rWMClass)

Reply via email to