Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Allow display to turn off for power saving during say all" #11524

Closed
wants to merge 2 commits into from

Conversation

LeonarddeR
Copy link
Collaborator

Issue

Reverts #11118
Restores #10643

Description of the issue

In #10643, I implemented support for the system not going to lock or sleep while in say all. #11118 changed this behavior, as some people found it problematic that the screen stays on during say all. However, after testing, it turns out that #11118 regressed in such a way that at least on my system with a group policy based lock timer, the system locks again during say all.

Testing performed

Tried reading a long piece of text with say all in notepad. Without this reversion, the system locked whereas with it, it keeps reading.

@lukaszgo1
Copy link
Contributor

Given the fact that @LeonarddeR 's use case is not a very common one would it be possible to have this configurable? For laptop users it is really inconvenient to have screen on during Say all. Screen curtain is not a solution for this because even though screen stays black brightness is set at the level specified in the Windows settings and therefore more battery power is wasted without a good reason.

@LeonarddeR
Copy link
Collaborator Author

More battery power is wasted without a good reason.

Do you have any evidence that this has major impact on battery life? Note that in many applications, using say all changes the cursor position which triggers the idle prevention behavior automatically. I'm pretty sure notepad (edit text controls) and browse mode are a few of the exceptions to this rule.
I'm a bit reluctant to make this configurable as the impact of both the ES_SYSTEM_REQUIRED and ES_DISPLAY_REQUIRED flag is a bit vague. For me, both flags give the best result.
An alternative I"m happy to consider though, is disabling the behavior altogether with say all for the review cursor, since that's a virtual cursor. Would that help?

@lukaszgo1
Copy link
Contributor

@LeonarddeR wrote:

More battery power is wasted without a good reason.

Do you have any evidence that this has major impact on battery life?

I haven't measured it but it is logical to assume that display which is completely turned off uses less power than one turned on.

I'm a bit reluctant to make this configurable as the impact of both the ES_SYSTEM_REQUIRED and ES_DISPLAY_REQUIRED flag is a bit vague. For me, both flags give the best result.

Since we don't really know what these flags do why not try to investigate other approaches?
For me executing SystemParametersInfoA with the SPI_SETSCREENSAVEACTIVE set to false seems to do the trick that is screen saver is disabled and screen still turns off after configured timeout. Does it work for you?

An alternative I"m happy to consider though, is disabling the behavior altogether with say all for the review cursor, since that's a virtual cursor. Would that help?

I don't think say all with review cursor is commonly used.

@LeonarddeR
Copy link
Collaborator Author

For me executing SystemParametersInfoA with the SPI_SETSCREENSAVEACTIVE set to false seems to do the trick that is screen saver is disabled and screen still turns off after configured timeout. Does it work for you?

The problem with that is that it really changes a setting in the user profile.

@lukaszgo1
Copy link
Contributor

Please note the following remark from the documentation:

This parameter can be zero if you do not want to update the user profile or broadcast the WM_SETTINGCHANGE message,...

@LeonarddeR
Copy link
Collaborator Author

Please note the following remark from the documentation:

This parameter can be zero if you do not want to update the user profile or broadcast the WM_SETTINGCHANGE message,...

Good point. However, I think this still updates the parameter for the lifetime of the session, which is pretty different from what we're doing now (resetting a counter)

@LeonarddeR
Copy link
Collaborator Author

I had a quick chat with a colleague about this issue. It seems at our office, there is a link with the display turn off power setting in power and sleep settings that automatically locks the system when the display power goes off. That clarifies why ES_DISPLAY_REQUIRED is necessary in my particular setup.
I have that setting under my control, so I changed it to a higher value and now it works again.
It still puzzles me how the screen timeout could also lock the system, as that is non-default (i.e. it just should turn off instead of lock). But it proves @lukaszgo1 point that my case is probably a rare one.

@LeonarddeR LeonarddeR closed this Aug 26, 2020
@LeonarddeR LeonarddeR deleted the revert-11118-sayAllNoDisplayRequired branch November 18, 2020 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants