#5719 Detect hybernation #2#5876
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reworks Windows suspend/hibernate handling so the viewer records a close marker and reports suspend-related state instead of immediately initiating shutdown.
Changes:
- Adds suspend/resume callbacks through the window callback interface and viewer window implementation.
- Updates Windows
WM_POWERBROADCASThandling to mark potential close on suspend and clear it on resume. - Adds
LAST_EXEC_OS_EVENTand reports close-marker startup detection as an OS event.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
indra/newview/llviewerwindow.h |
Declares new suspend/resume callback overrides. |
indra/newview/llviewerwindow.cpp |
Implements close-marker cleanup on resume and stats sending on suspend. |
indra/newview/llappviewer.h |
Adds the OS event enum value and stats-sending API. |
indra/newview/llappviewer.cpp |
Updates marker processing and adds the stats wrapper. |
indra/llwindow/llwindowwin32.cpp |
Changes Windows suspend/resume power broadcast handling. |
indra/llwindow/llwindowcallbacks.h |
Adds base callback declarations. |
indra/llwindow/llwindowcallbacks.cpp |
Adds default no-op callback implementations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c57ecd9 to
9eeef33
Compare
|
For now this is done, should work fine by itself, but will be improved with #5856. |
|
|
||
| void LLViewerWindow::handleSuspendRequest() | ||
| { | ||
| LLAppViewer::instance()->sendViewerStatistics(); |
There was a problem hiding this comment.
Not sure, but simple logging inside handleSuspendRequest() and handleCloseRequestCanceled() may be useful.
There was a problem hiding this comment.
We are already doing logging in window code, but wouldn't hurt, thank you.
There was a problem hiding this comment.
Done it in the next commit.
Reworked how hybernation works. There will be a follow up PR that adjust this slightly and implements #5856.