Skip to content

#5719 Detect hybernation #2#5876

Merged
akleshchev merged 1 commit into
developfrom
andreyk/viewer_5719_2
May 29, 2026
Merged

#5719 Detect hybernation #2#5876
akleshchev merged 1 commit into
developfrom
andreyk/viewer_5719_2

Conversation

@akleshchev
Copy link
Copy Markdown
Contributor

@akleshchev akleshchev commented May 29, 2026

Reworked how hybernation works. There will be a follow up PR that adjust this slightly and implements #5856.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_POWERBROADCAST handling to mark potential close on suspend and clear it on resume.
  • Adds LAST_EXEC_OS_EVENT and 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.

Comment thread indra/llwindow/llwindowwin32.cpp
Comment thread indra/newview/llappviewer.cpp Outdated
Comment thread indra/newview/llappviewer.cpp Outdated
Comment thread indra/newview/llappviewer.cpp Outdated
Comment thread indra/newview/llappviewer.cpp Outdated
Comment thread indra/newview/llviewerwindow.cpp Outdated
Comment thread indra/newview/llviewerwindow.cpp Outdated
@akleshchev akleshchev force-pushed the andreyk/viewer_5719_2 branch from c57ecd9 to 9eeef33 Compare May 29, 2026 17:51
@akleshchev akleshchev linked an issue May 29, 2026 that may be closed by this pull request
@akleshchev akleshchev marked this pull request as ready for review May 29, 2026 18:17
@akleshchev
Copy link
Copy Markdown
Contributor Author

For now this is done, should work fine by itself, but will be improved with #5856.


void LLViewerWindow::handleSuspendRequest()
{
LLAppViewer::instance()->sendViewerStatistics();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, but simple logging inside handleSuspendRequest() and handleCloseRequestCanceled() may be useful.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are already doing logging in window code, but wouldn't hurt, thank you.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done it in the next commit.

@akleshchev akleshchev merged commit edf982b into develop May 29, 2026
15 checks passed
@akleshchev akleshchev deleted the andreyk/viewer_5719_2 branch May 29, 2026 22:35
@github-actions github-actions Bot locked and limited conversation to collaborators May 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Win] Shut viewer down on sleep or hybernation

3 participants