Make Screen Curtain profile independent#19177
Conversation
|
#10476 is too long for me to finish reading, but I just want to confirm one thing: will this change cause the screen curtain to not follow the process-name-based profile? If so, that would be terrible. I have a very important use case: I created separate profiles for my instant messaging applications, such as "WeChat," because I don't want these applications to be displayed in specific scenarios, while for other applications I don't think it matters much, so I don't want to enable the screen curtain. |
32512a2 to
af73311
Compare
af73311 to
987caeb
Compare
That is correct. The screen curtain will apply to all profiles.
Unfortunately, as things stand there is no solution that will please everyone. We have made the decision to make the screen curtain profile independent as we feel that this provides the best experience for users in terms of privacy. Perhaps as NVDA's configuration profile support improves this will be a use-case that can be added back. |
It's not even a matter of pleasing everyone, or satisfying different use cases. The privacy issue is as follows: |
|
@SaschaCowley wrote:
In the few add-ons that seem to use screen curtain API, most seem to be just testing if screen curtain is active or not to perform OCR, recognition, etc. with the following code (or similar): Thus, I do not expect them to have difficulty to adapt to the new code if necessary. Since 2026.1 will already be an important API-breaking release, I'd be in favor to take the opportunity to simplify NVDA's code here and remove the stub, rather than keeping this deprecated stub for only few add-ons. |
|
@seanbudd, @SaschaCowley this PR replaces all existing use of
But for existing translatable strings that have already been translated for 5 years and that do not need disambiguation, there is no added value to switch to Would you mind consider switching back to |
|
Sorry, I had not seen that my previous comment regarding |
Co-authored-by: Sean Budd <sean@nvaccess.org>
dca9c92 to
2890d2c
Compare
CyrilleB79
left a comment
There was a problem hiding this comment.
Nice! All good for me.
seanbudd
left a comment
There was a problem hiding this comment.
Thanks @SaschaCowley - happy with this too. I have some suggestions, but I'm not sure how appropriate they are
I think because we have called the feature "Screen Curtain" (and it's capitalised like feature names we've used) - but the words themselves are common and could simply be written in a sentence which would make sense even if we didn't have such a feature (and in that case you would use "the"). If we change this, we should probably change other references to match. Co-authored-by: Sean Budd <sean@nvaccess.org>
Qchristensen
left a comment
There was a problem hiding this comment.
Reads well. Following Sean's suggestion about dropping "the" from "the Screen Curtain", I've changed other references in the user guide (I note there other uses of "the Screen Curtain" in the code comments but haven't changed those)
Co-authored-by: Quentin Christensen <quentin@nvaccess.org>
Fixes #19263 Closes #10545 Possible fix for #18693 and #18743 ### Summary of the issue: Since #19177, if Screen Curtain fails to initialise because `isScreenFullyBlack` returns `False`, NVDA crashes (#19263). It would appear that from time to time, bitblitting from the desktop context to the capture context in `nvdaHelper/local/screenCurtain.cpp` failes due to one or both of the context handles being invalid. I have no idea why this happens, but can only surmise that it's a timing issue, as we check the validity of the contexts upon creation, so something must be invalidating them in the meantime. I strongly suspect that this is the underlying cause of Screen Curtain failing to be activated on the Windows login screen (#18743) and after login (#18693). ### Description of user facing changes: NVDA no longer crashes if Screen Curtain fails to be enabled when initializing NVDA. Screen curtain may be enabled more reliably at the login screen and immediately after login. I have not included a change log entry, because #19263 was introduced as part of 2026.1 alphas, and I don't know if this PR fixes #18693 or #18743. ### Description of developer facing changes: None ### Description of development approach: * In `screenCurtain._screenCurtain.ScreenCurtain.enable`, add logic to automatically retry enabling the Screen Curtain a fixed number of times before admitting defeat. If the issue really is a race condition or other timing issue, future retries should theoretically be uneffected by the issue, so it will succeed. Currently the maximum number of attempts is hardcoded at 3. * In `screenCurtain._screenCurtain.ScreenCurtain.__init__`, wrap `self.enable` in a try/except block. * In `gui.settingsDialogs.PrivacyAndSecurityDialog._ensureScreenCurtainEnableState`, wrap `screenCurtain.screenCurtain.enable` in a try/except block, and notify the user when enabling the screen curtain has failed. ### Testing strategy: Intentionally introduced errors into `screenCurtain._screenCurtain.ScreenCurtain.enable`, and ensure that the error handling works correctly. Intentionally introduced errors that only happen a fixed number of times into `screenCurtain._screenCurtain.ScreenCurtain.enable`, and ensure that the retry logic works correctly. ### Known issues with pull request: None
Fix-up of #19177. Summary of the issue: Since #19177, Screen curtain settings have been moved from Vision to "Privacy and Security" settings panel in the settings dialog. Though, in the input gestures dialog, its toggle command is still located in the Vision category. This is not consistent. Description of user facing changes: In the input gestures dialog, the screen curtain toggle command is now located in the Misc category rather than in the Vision category. Description of developer facing changes: N/A Description of development approach: Removed the category of the script. A script with no category lands in the Misc category.
Link to issue number:
Fixes #10476
Partially addresses #16272
Summary of the issue:
Currently, the Screen Curtain is configuration profile dependent. This can lead to situations in which it is unexpectedly deactivated by a config profile change.
Description of user facing changes:
Description of developer facing changes:
The
visionEnhancementProviders.screenCurtainmodule has bee removed.Description of development approach:
screenCurtainsubpackage, and migrated the existingvisionEnhancementProviders.screenCurtainimplementation.screenCurtain._screenCurtain. The public API is accessible fromscreenCurtan, including the globalscreenCurtain.screenCurtainobject.core.mainandcore.resetConfigurationto initializeand terminate screen curtain.gui.settingsDialogs.visionEnhancementProviders.screenCurtainmodule, and updated the change log to reflect that previously deprecated symbols that had redirects in this module have been removed.visionand into the root section. As the config keys are otherwise identical, this is all that is necessary.pgettext(category "screenCurtain")Testing strategy:
Running from source:
nvda.ini.Known issues with pull request:
None
Code Review Checklist: