Skip to content

Commit 9800cde

Browse files
committed
Update llsdlfiledialog.h
1 parent 1fc3679 commit 9800cde

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

indra/newview/llsdlfiledialog.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ namespace LLSDLFileDialog
8181
template <typename ResultT>
8282
inline void trampoline(void* userdata, const char* const* filelist, int /*filter*/)
8383
{
84-
// Dialog resolved; close the bracket opened in show(). Restores
85-
// fullscreen/mouselook and, once the last dialog closes, key focus.
86-
LLWindowSDL::exitDialog();
84+
// Close the bracket opened in show(), on the main thread: the callback can
85+
// fire on a worker thread (the Linux Zenity backend), and exitDialog()
86+
// touches mDialogDepth and window focus. Runs inline when already on main.
87+
SDL_RunOnMainThread([](void*) { LLWindowSDL::exitDialog(); }, nullptr, false);
8788

8889
auto* ctx = static_cast<LLSDLFileDialogContext<ResultT>*>(userdata);
8990
auto* cb = ctx->mCallback;

0 commit comments

Comments
 (0)