Prevent system sleep when reading lon pieces of text with braille only#10111
Conversation
|
I confirm this PR resolve the problem explain in #9175 but unfortunitly no solution was find for screensaver. |
|
In the issue above @ pzajda asked about SetThreadExecutionState with the flag ES_DISPLAY_REQUIRED. I am no expert on this, but according to the documentation it should disable the screen saver. |
|
From the SetThreadExecutionState remarks section:
I can create a try build with ES_DISPLAY_REQUIRED, but it feels a bit like a waste of time to try this when Microsoft explicitly states that it's not going to work. |
|
Another really irritating issue is when there is an update and it seems nvda
does not get the focus forcible to notice the countdown to the reset, often
resulting in the thing shutting down while nvda is reading a long document
in audio.
This is on Windows 7, but I was told it also happens on 10, but do not know
which version.
Brian
bglists@blueyonder.co.uk
Sent via blueyonder.
Please address personal E-mail to:-
briang1@blueyonder.co.uk, putting 'Brian Gaff'
in the display name field.
Newsgroup monitored: alt.comp.blind-users
-----
|
michaelDCurran
left a comment
There was a problem hiding this comment.
All looks good, barring my comment about ES_DISPLAY_REQUIRED.
| queueHandler.queueFunction(queueHandler.eventQueue, speech.pauseSpeech, speechEffect == gesture.SPEECHEFFECT_PAUSE) | ||
|
|
||
| if gesture.shouldPreventSystemIdle: | ||
| winKernel.SetThreadExecutionState(winKernel.ES_SYSTEM_REQUIRED) |
There was a problem hiding this comment.
I do think that we should also include ES_DISPLAY_REQUIRED here, as this will cause Windows not to power off the display. See:
https://docs.microsoft.com/en-us/windows/win32/power/system-sleep-criteria
I do agree it is confusing whether or not it will specifically disable the screen saver though due to the comment in the documentation for SetThreadExecutionState.
There was a problem hiding this comment.
Makes sense. I initially thought that it would actually be an energy savings benefit that the screen would go black if you have a short screen idle timeout, but it is probably confusing that it stops one idle timer and not the other.
When a system is set up to lock or go to sleep within one minute, say all could be interrupted when reading long paragraphs in virtual buffers. Possibly in other cases as well. Similar to #10111. We instruct the system not to sleep. This happens on every line we reach.
Fixes #17649 Partially reverts #11118 Follow up of #10111, #10643, Summary of the issue: On some systems (mine, for example 😉) the screen still locks during a say all even though we reset the system idle timer. We also reset the display timer in the past, but this was reverted in #11118, particularly on request of @btman16 Description of user facing changes Added a new advanced setting that, when enabled, also resets the display timer. Description of development approach Added new helper/wrapper methods to systemUtils Rather than resetting the timer(s) many times during a say all, we now persist the state during say all using the ES_CONTINUOUS flag. This should avoid an edge case where reading a line takes more then a minute and the sleep timer is a minute, in which case the system will still lock.
Link to issue number:
Fixes #9175
Summary of the issue:
When reading long parts of text in braille with braille display gestures, the system isn't getting any input from a normal input device. Therefore, the system idle timer isn't reset, and at some point, the system goes into stand by.
Description of how this pull request fixes the issue:
Added a new
shouldPreventSystemIdleattribute on gestures. If True, NVDA resets the system idle timer when processing the gesture.Testing performed:
If I understand @CBC33000 correctly, in #9175 (comment), this fixes the issue.
Known issues with pull request:
This pr doesn't prevent the screen saver to activate. Unfortunately, the docs for SetThreadExecutionState explicitly state that preventing screen saver activation is not supported.
Change log entry: