Emscripten: Pre-cancel synchronous execution of modal dialogs
...which would run into Application::Yield -> std::abort, so better live with this hack for now. (The way forward would be to either asyncify relevant dialogs, or move to Qt6 and --enable-emscripten-jspi.) Change-Id: I143747cc32fb163e4908fa42b031e4eaea697d29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182731 Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Tested-by: Jenkins
This commit is contained in:
@@ -129,7 +129,7 @@ public:
|
||||
virtual FactoryFunction GetUITestFactory() const override;
|
||||
|
||||
private:
|
||||
bool ImplStartExecute();
|
||||
bool ImplStartExecute(bool async);
|
||||
static void ImplEndExecuteModal();
|
||||
void ImplSetModalInputMode(bool bModal);
|
||||
|
||||
|
||||
@@ -907,7 +907,7 @@ bool Dialog::Close()
|
||||
}
|
||||
}
|
||||
|
||||
bool Dialog::ImplStartExecute()
|
||||
bool Dialog::ImplStartExecute(bool async)
|
||||
{
|
||||
setDeferredProperties();
|
||||
|
||||
@@ -951,6 +951,14 @@ bool Dialog::ImplStartExecute()
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!async && Application::IsUseSystemEventLoop())
|
||||
{
|
||||
// As long as Application::Yield deliberately calls std::abort when trying to
|
||||
// synchronously execute modal dialogs, better cancel them here for now as a hack:
|
||||
SAL_WARN(
|
||||
"vcl", "cancel synchronous execution of modal dialog " << ImplGetDialogText(this));
|
||||
return false;
|
||||
}
|
||||
|
||||
switch ( Application::GetDialogCancelMode() )
|
||||
{
|
||||
@@ -1081,7 +1089,7 @@ short Dialog::Execute()
|
||||
mbInSyncExecute = false;
|
||||
});
|
||||
|
||||
if ( !ImplStartExecute() )
|
||||
if ( !ImplStartExecute(false) )
|
||||
return 0;
|
||||
|
||||
// Yield util EndDialog is called or dialog gets destroyed
|
||||
@@ -1111,7 +1119,7 @@ short Dialog::Execute()
|
||||
bool Dialog::StartExecuteAsync( VclAbstractDialog::AsyncContext &rCtx )
|
||||
{
|
||||
const bool bModal = GetType() != WindowType::MODELESSDIALOG;
|
||||
if (!ImplStartExecute())
|
||||
if (!ImplStartExecute(true))
|
||||
{
|
||||
rCtx.mxOwner.disposeAndClear();
|
||||
rCtx.mxOwnerDialogController.reset();
|
||||
|
||||
Reference in New Issue
Block a user