diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2026-02-25 03:00:09 +0200 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-03-02 17:37:12 +0200 |
| commit | c94a118af80367c3f73cfe93559185c8f2cf3750 (patch) | |
| tree | dfc06d2a0863960de188093c47b7ab6c02919936 | |
| parent | ed418397a17573f0bf72991cb8348558e1049f14 (diff) | |
#5084 Fix mac's watchdog not catching test case
This happens because on mac watchdog quits at the end of frame. And events get handled outside the frame. The might be other cases that need similar handling.
| -rw-r--r-- | indra/llwindow/llwindowmacosx-objc.h | 2 | ||||
| -rw-r--r-- | indra/newview/llappdelegate-objc.mm | 2 | ||||
| -rw-r--r-- | indra/newview/llappviewermacosx.cpp | 10 |
3 files changed, 14 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index b302a705da..ec9afb1844 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -78,6 +78,8 @@ void initMainLoop(); void cleanupViewer(); void handleUrl(const char* url); void dispatchUrl(std::string url); +void startWatchdog(std::string_view state); +void stopWatchdog(); /* Defined in llwindowmacosx-objc.mm: */ int createNSApp(int argc, const char **argv); diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 0b3d0355a2..d3aac5a43e 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -395,11 +395,13 @@ struct AttachmentInfo - (void)sendEvent:(NSEvent *)event { + startWatchdog("sendEvent"); // events are outside pumpMainLoop [super sendEvent:event]; if ([event type] == NSEventTypeKeyUp && ([event modifierFlags] & NSEventModifierFlagCommand)) { [[self keyWindow] sendEvent:event]; } + stopWatchdog(); // leaving scope } @end diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index b074c40c17..2bd9c8661a 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -135,6 +135,16 @@ void cleanupViewer() gViewerAppPtr = NULL; } +void startWatchdog(std::string_view state) +{ + gViewerAppPtr->resumeMainloopTimeout(state); +} + +void stopWatchdog() +{ + gViewerAppPtr->pauseMainloopTimeout(); +} + void clearDumpLogsDir() { if (!LLAppViewer::instance()->isSecondInstance()) |
