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

configuration profiles, a bug when sometimes nvda stops using a profile when it shouldn't #14608

Closed
amirmahdifard opened this issue Feb 2, 2023 · 22 comments
Labels
close/duplicate needs-technical-investigation A technical investigation is required to progress the issue. needs-triage p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority

Comments

@amirmahdifard
Copy link

Discription:

i hope you understand my explanation, however, i hardly posting this, as i didn't know how to explane this: so, sometimes, when you have a profile and you are using that application you can do some stuf that nvda will stop using that application's profile and falls back to the normal configuration profile, and to fix it, you need to do something to go back to that window again, for example, you need to press windows key to go to start menu, and press it again to go back to that window so nvda will start to use that application's profile, or you need to go to another window and come back to this window again with alt tab keys, or you just press windows + m to go to desktop and back to this window again to make the nvda to use that profile again: but, this bug is happening really randomly and in so meny cases, so i can't just say that it is only happens in this case, or only in that case, because it can happen with anything else, but i will example some cases that this bug is happening on, so that you guys will be able to reproduce this: when you are in an application that you have a profile for it in the applications window, if you have 2 keybord lang on your computer, try to change your keybord lang with windows + space keys, if you do this, the nvda will fall back to normal configuration, or, if the application is not responding, and if you get this dialog blaablaa is not responding if you close it, you mite loos information: but you don't press anything, just wait for that dialog to go away and you back in to that application automatikly, you will see that your nvda will fall on normal configuration, until you focus on that window again manually with alt tab or something

Steps to reproduce:

1: for example, create a profile for your notepad
2: do some changes on it that your normal configuration profile doesn't have those changes, for example, disable speeck typed characters and speeck typed words for that profile, while your normal configuration have them enabled: note: it doesn't matter if you do some changes on the profile or keep it same as your normal configuration, i'm just telling you to do some changes so that you will be able to notice it quickly as soon as it falls back to the normal configuration profile
3: in the notepad window, press your windows + space, or do something that windows will show a dialog to you saying notepad is not responding, and then don't tuch your keybord, until this dialog whent away, and put you back on your notepad window: now, work with your notepad, you will see that it is back to the normal configuration profile and is not using your notepad profile anymore: and also, another prove for this, as long as you didn't swich your windows after this happened to you and it faled back on normal configuration profile, press NVDA + n to go to the nvda menu, and open configuration profiles, or just press the shortcut to open the configuration profiles, and you will see that it will say normal configuration editing, it won't say notepad editing, triggered

Actual behavior:

nvda sometimes randomly stops using the current application's profile and falls back to the normal configuration profile, depending on some buttons that you press on your keybord, or even you are not tuching anything, windows will just show a dialog to you and disappear after some time and puts you back in to that window again, then in these cases, nvda stops using the current application's profile, i don't know, but i guess it seems that nvda can't detect that window automatikly properly in some cases like this

Expected behavior:

nvda should always use the application's profile, as long as you are using that application and its window is open for you even if anything happened, and if you pressed any of your keybord buttons as long as you are still in that window and you didn't go out of the window yourself, so nvda should detect that window automatikly

NVDA logs, crash dumps and other attachments:

System configuration

NVDA installed/portable/running from source:

installed

NVDA version:

2022.4

Windows version:

Windows 10 22H2 (AMD64) build 19045.2486

Name and version of other software in use when reproducing the issue:

can be anything, because you can create configuration profiles for every application, just as long as it is not a tray application or something, it should have a window, then it's ok

Other information about your system:

not needed

Other questions

Does the issue still occur after restarting your computer?

yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

all versions have this problem as much as i tested and i know.

If NVDA add-ons are disabled, is your problem still occurring?

yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

yes

@Brian1Gaff
Copy link

Brian1Gaff commented Feb 3, 2023 via email

@amirmahdifard
Copy link
Author

i don't know, all i know for now is that nvda canot detect that exe file window that is in the focus, and in some cases, it interupted that nvda canot detect anymore when windows will automatikly change dialogs, or when you press some random buttons, i figgered out windows + space for now, hopefully it is reproduceable for the developers

@amirmahdifard
Copy link
Author

@CyrilleB79 @josephsl @LeonarddeR sorry to mention you all even if you saw this issue already, but can you confurm this bug, can be any development for a fix to this bug? thanks.

@amirmahdifard
Copy link
Author

oops, i'm sorry, closing and reopening was a mistake from my browser

@CyrilleB79
Copy link
Collaborator

@amirmahdifard please do not Cc every active contributor each time you open a new issue.

Speaking for myself, this won't convince me to work on the issue. I already keep an eye regularly on NVDA's GitHub issues. If I have time and feel I have something to bring, I will contribute, either by commenting (e.g. trying to reproduce) or providing a solution (design or PR).

There are almost 3000 open issues. And only few of them are answered quickly. If after some weeks or a few months you do not get any answer you may ask for an answer CCing other persons. In the mean time, just wait and keep reporting other issues or ideas as you already do.

So please, as I wrote already before, be patient. I hope you understand. Many thanks.

@CyrilleB79 @josephsl @LeonarddeR sorry to mention you all even if you saw this issue already, but can you confurm this bug, can be any development for a fix to this bug? thanks.

@amirmahdifard
Copy link
Author

@CyrilleB79 ok, sorry

@seanbudd seanbudd added needs-technical-investigation A technical investigation is required to progress the issue. p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority labels Feb 14, 2023
@seanbudd
Copy link
Member

If anyone is able to give some clearer steps to reproduce, it would be helpful in trying to investigate this.

@amirmahdifard
Copy link
Author

@seanbudd but i already did, is that not good enough for reproducing it? i tryed my best.

@Adriani90
Copy link
Collaborator

Adriani90 commented Feb 14, 2023

Hmm this is gonna be really hard to reproduce, I've seen this behavior randomly on PCs that are slow or in applications that crash from time to time. With the steps described in the issue description I cannot reproduce it.
@amirmahdifard I think a log file would really help in investigating this issue.

Can you please

  1. Enable your log level in the NVDA general settings by setting it to "debug"
  2. Restart NVDA with all addons disabled
  3. Reproduce this issue with your own steps
  4. Imediately after you see the problem occuring, press nvda+f1. This will open the log file
  5. Save that log file as .txt or .log file and attach that file to this issue.

@Adriani90
Copy link
Collaborator

I wonder if #13187 and #13189 could somehow be related to this?

@Adriani90
Copy link
Collaborator

This issue could actually be a duplicate of #11198.

@amirmahdifard
Copy link
Author

it is similer to this, but not duplicate: i will provide a log file if nvda actually print a log for this

@amirmahdifard
Copy link
Author

ok, i've got a log for you in debug, and i red it, after it said that i pressed windows plus space, it deactivated my profile, so you can read it: note 2: i didn't try with notepad, i tryed with an appliccation that i already had a profile for it and i have some difrent settings in that profile already, but i know that this also happens with notepad too.
nvda log.txt

@amirmahdifard
Copy link
Author

hope this helps you guys, and hope that this issue gets fixed soon, so we won't get any more problems with this nice feature in nvda.

@Adriani90
Copy link
Collaborator

Actually when you press windows+space and hold it pressed, a popup window appears and for that pop up window the standard profile is triggered. However, when that window disappears it seems your actual profile is not re-triggered for what ever reason. I think it might have to do with the foreground window not being detected correctly by NVDA unless you press alt+tab twice to re-focus the window.

Did you maximize the application window before reproducing this issue? Maybe it is also something related to the DPI and screen resolution but not sure. cc: @michaelDCurran

@amirmahdifard
Copy link
Author

@Adriani90 yes exactly, that's what i also said in one of my comments in here, it's happening when a popup or a dialogue is appearing and then disappearing, and to fix it, we have to switch the windows with alt tab, and come back to this window again to fix it.

@amirmahdifard
Copy link
Author

ok guys, i've now got even more information for you to fix this: this bug is so random, so, when you press windows + space, sometimes the window will retreev back again and the nvda will also activate the profile, but sometimes randomly, when you press it, randomly when the window doesn't go back, the profile also doesn't reactivate, until you press alt tab 2 times to refocus this window: but since this bug is happening with the normal windows applications so randomly, i can help you more and tell you some specific applications that this bug happens with them moste of the times: the applications that are coded with bgt programming script: bgt is a programming script that blind people are making audio games with it: stw is one of them, but its website is offline at the moment, but another bgt application that this bug happens with, is SBYw (Sketchbook Your World) you can download it from this website: sbyw.games warning: sadly, the anty virus programs detects the programs coded with bgt as virus, other blind people who known with bgt can confurm this: you can download the bgt from the blindhelp.net website if you want to work with this script: bgt is a game engin script made by c++ programming lang.

@amirmahdifard
Copy link
Author

hi,
guys, today in the SBYW game, in the chat, i talked to the sbyw's developer and to notify you again, sbyw is a game coded with bgt, so he is actually a bgt developer, so i asked him about this, i will now show you all the messages that i sent and he sent: the messages are name of the person, with a colen and a space and the message: amir is me, and Zehnomore is the developer of bgt sbyw he mentioned some things that made sence in my opinion: below is the messages.
Zehnomore: so there's nothing I can do on that front, but I think I know what you're talking about when the focus ends up in a kind of limbo. It's because, I think, when the win+space window disappears your focus doesn't automatically land back in the BGT window but in some kind of dummy window, mine used to do that.
Amir: yes I know you cannot do anything about that, I just want to know if the problem is from nvda, or bgt?
Zehnomore: I don't know actually, you'd have to ask its dev how he construct windows. I don't think the keyhook has anything to do with it, but also if it is a dummy window it isn't BGT"s fault either, dummy windows are generated by systray applications that are kind of naughty
Zehnomore: I've had iCloud and foobar2000 generate dummy window that the focus would fall into if the fornground window closed somehow, when it's supposed to dump to the previous window or, failing that, the taskbar
Zehnomore: the fact that win+space is an overlay exadurates this effect as overlays behave kind of strangely
Zehnomore: emoji panel does the same thing
Amir: i felt it is a bgt problem because bgt doesn't really focus properly on the windows and nvda may be cannot retreev the window
Zehnomore: maybe because of the way it pumps the windows event loop
Zehnomore: because yeah it is a bit slower to gain focus than most other apps
Zehnomore: could it be some kind of timing issue?
Zehnomore: like NVDA expects a focus change and doesn't get one as quickly as it assumed so it quits waiting by the time it arrives?
Amir: anyway, if you know anything useful about this, you can comment it there because they are all confused there, and then I mentioned about bgt in my last comment in there.
and that was all: i hope by reading these, you get any new ideas about this bug happening because he mentioned a fue things that you can know more about them as nvda developers: thanks.

@Adriani90
Copy link
Collaborator

So it seems it is related to focus redirection and how NVDA handles the window. In case of windows+space bar, NVDA does not have a window handle for it. So redirecting the focus from an invalid object where there is no window handle back towards a valid object seems to fail. I get following error when pressing tab after releasing of windows]space, though tab character are written to the Word document but NVDA cannot interact with the window anzmore.
STR>

  1. Open MS Word
  2. Press and hold windows+space bar
  3. Release windows+space bar command
  4. Press tab or shift+tab.

Actual:
The document is not getting NVDA focus, but tab characters are typed in the document
Following errors are written to the log:

IO - inputCore.InputManager.executeGesture (14:43:45.553) - winInputHook (2000):
Input: kb(laptop):windows+space
DEBUGWARNING - IAccessibleHandler.internalWinEventHandler._shouldGetEvents (14:43:45.863) - MainThread (23528):
Foreground took too long to change. Foreground still 198416 (OpusApp). Should be 984986 (Shell_InputSwitchTopLevelWindow)
DEBUG - config.ConfigManager._triggerProfileExit (14:43:45.893) - MainThread (23528):
Deactivating triggered profile Word
DEBUG - config.featureFlag._validateConfig_featureFlag (14:43:45.893) - MainThread (23528):
Validating feature flag: DEFAULT, optionsEnum: BoolFlag, behaviorOfDefault: ENABLED
DEBUG - config.featureFlag._validateConfig_featureFlag (14:43:45.893) - MainThread (23528):
Validating feature flag: DEFAULT, optionsEnum: ReviewRoutingMovesSystemCaretFlag, behaviorOfDefault: NEVER
DEBUG - config.featureFlag._validateConfig_featureFlag (14:43:45.893) - MainThread (23528):
Validating feature flag: DEFAULT, optionsEnum: BoolFlag, behaviorOfDefault: ENABLED
DEBUG - config.featureFlag._validateConfig_featureFlag (14:43:45.893) - MainThread (23528):
Validating feature flag: DEFAULT, optionsEnum: BoolFlag, behaviorOfDefault: ENABLED
DEBUG - config.featureFlag._validateConfig_featureFlag (14:43:45.893) - MainThread (23528):
Validating feature flag: DEFAULT, optionsEnum: BoolFlag, behaviorOfDefault: ENABLED
DEBUG - config.featureFlag._validateConfig_featureFlag (14:43:45.893) - MainThread (23528):
Validating feature flag: DEFAULT, optionsEnum: BoolFlag, behaviorOfDefault: ENABLED
DEBUG - config.featureFlag._validateConfig_featureFlag (14:43:45.893) - MainThread (23528):
Validating feature flag: DEFAULT, optionsEnum: BoolFlag, behaviorOfDefault: ENABLED
DEBUG - config.featureFlag._validateConfig_featureFlag (14:43:45.893) - MainThread (23528):
Validating feature flag: SINGLE_LINE_BREAK, optionsEnum: ParagraphNavigationFlag, behaviorOfDefault: APPLICATION
DEBUG - config.featureFlag._validateConfig_featureFlag (14:43:45.893) - MainThread (23528):
Validating feature flag: DEFAULT, optionsEnum: WindowsTerminalStrategyFlag, behaviorOfDefault: DIFFING
DEBUG - synthDriverHandler.SynthDriver.loadSettings (14:43:45.893) - MainThread (23528):
Loaded changed settings for SynthDriver espeak
DEBUG - braille.BrailleHandler._switchDisplay (14:43:45.893) - MainThread (23528):
Reinitializing 'noBraille' braille display
DEBUG - autoSettingsUtils.autoSettings.AutoSettings._registerConfigSaveAction (14:43:45.893) - MainThread (23528):
registering pre_configSave action: <class 'brailleDisplayDrivers.noBraille.BrailleDisplayDriver'>
DEBUG - autoSettingsUtils.autoSettings.AutoSettings._loadSpecificSettings (14:43:45.893) - MainThread (23528):
loading braille noBraille
INFO - braille.BrailleHandler._setDisplay (14:43:45.893) - MainThread (23528):
Loaded braille display driver 'noBraille', current display has 0 cells.
DEBUGWARNING - hwPortUtils.listUsbDevices (14:43:45.893) - ThreadPoolExecutor-1_0 (19016):
Couldn't get DEVPKEY_Device_BusReportedDeviceDesc for {'hardwareID': 'USB\\VID_8087&PID_0033&REV_0000', 'usbID': 'VID_8087&PID_0033', 'devicePath': '\\\\?\\usb#vid_8087&pid_0033#5&242a2f40&0&10#{a5dcbf10-6530-11d2-901f-00c04fb951ed}'}: [WinError 1168] Element nicht gefunden.
IO - speech.speech.speak (14:43:45.903) - MainThread (23528):
Speaking ['Sprachumschaltungsliste', 'Liste', CancellableSpeech (still valid)]
IO - speech.speech.speak (14:43:45.908) - MainThread (23528):
Speaking ['Japanisch Microsoft-IME', '3 von 3', CancellableSpeech (still valid)]
DEBUGWARNING - UIAHandler.UIAHandler.getNearestWindowHandle (14:43:46.733) - Dummy-1 (11364):
error walking up to an element with a valid windowHandle
Traceback (most recent call last):
  File "UIAHandler\__init__.pyc", line 1314, in getNearestWindowHandle
_ctypes.COMError: (-2147467259, 'Unbekannter Fehler', (None, None, None, 0, None))
DEBUGWARNING - NVDAObjects.__call__ (14:43:46.733) - Dummy-1 (11364):
Invalid NVDAObject: no windowHandle
Traceback (most recent call last):
  File "NVDAObjects\__init__.pyc", line 93, in __call__
  File "NVDAObjects\UIA\__init__.pyc", line 1363, in __init__
NVDAObjects.InvalidNVDAObject: no windowHandle
IO - speech.speech.speak (14:43:46.748) - MainThread (23528):
Speaking ['Japanische Zeichen (Hiragana Roman)']
DEBUGWARNING - UIAHandler.UIAHandler.getNearestWindowHandle (14:43:46.773) - Dummy-1 (11364):
error walking up to an element with a valid windowHandle
Traceback (most recent call last):
  File "UIAHandler\__init__.pyc", line 1314, in getNearestWindowHandle
_ctypes.COMError: (-2147467259, 'Unbekannter Fehler', (None, None, None, 0, None))
DEBUGWARNING - NVDAObjects.__call__ (14:43:46.773) - Dummy-1 (11364):
Invalid NVDAObject: no windowHandle
Traceback (most recent call last):
  File "NVDAObjects\__init__.pyc", line 93, in __call__
  File "NVDAObjects\UIA\__init__.pyc", line 1363, in __init__
NVDAObjects.InvalidNVDAObject: no windowHandle
DEBUG - UIAHandler.shouldUseUIAInMSWord (14:43:46.783) - Dummy-1 (11364):
User does not want UIA in MS Word unless necessary
IO - inputCore.InputManager.executeGesture (14:43:48.543) - winInputHook (2000):
Input: kb(laptop):tab
DEBUG - UIAHandler.shouldUseUIAInMSWord (14:43:48.570) - MainThread (23528):
User does not want UIA in MS Word unless necessary
DEBUGWARNING - NVDAObjects.UIA.UIA._prefetchUIACacheForPropertyIDs (14:43:48.570) - MainThread (23528):
IUIAutomationElement.buildUpdatedCache failed given IDs of {30019, 30086, 30022, 30025, 30155, 30138, 30036, 30070, 30103, 30008, 30009, 30010, 30046, 30079}
ERROR - eventHandler.executeEvent (14:43:48.570) - MainThread (23528):
error executing event: typedCharacter on <NVDAObjects.UIA.ListItem object at 0x056B82F0> with extra args of {'ch': '\t'}
Traceback (most recent call last):
  File "eventHandler.pyc", line 327, in executeEvent
  File "eventHandler.pyc", line 115, in __init__
  File "eventHandler.pyc", line 124, in next
  File "NVDAObjects\__init__.pyc", line 1199, in event_typedCharacter
  File "speech\speech.pyc", line 1225, in speakTypedCharacters
  File "api.pyc", line 349, in isTypingProtected
  File "baseObject.pyc", line 62, in __get__
  File "baseObject.pyc", line 168, in _getPropertyViaCache
  File "NVDAObjects\__init__.pyc", line 1074, in _get_isProtected
  File "baseObject.pyc", line 62, in __get__
  File "baseObject.pyc", line 168, in _getPropertyViaCache
  File "NVDAObjects\UIA\__init__.pyc", line 1692, in _get_states
  File "NVDAObjects\UIA\__init__.pyc", line 987, in _getUIACacheablePropertyValue
_ctypes.COMError: (-2147418094, 'Der Aufgerufene (Server, nicht die Serveranwendung) ist nicht verfügbar und kann nicht gefunden werden. Alle Verbindungen sind ungültig. Der Aufruf wurde nicht ausgeführt.', (None, None, None, 0, None))

This happens when pressing alt+shift as well.
I think this is the reason why also the profile is not properly changed back.

Expected: NVDA should get propper focus to the word document after release of windows+space bar or alt+shift command.

I have following keyboard inputs installed:

  • German
  • English
  • Japanese Microsoft IME

cc: @josephsl, @jcsteh maybe you have some ideas on how to fix this.

@Adriani90
Copy link
Collaborator

This errors can be reproduced in notepad++ or any browser window as well.

@josephsl
Copy link
Collaborator

Hi,

In this case, when the input switcher window closes, NVDA knows that it should find out what the foreground/focus window is, but it fails due to window handle fetch issue (either the handle is NULL (0) or an issue occurred due to 32-bit/64-bit mismatch). I'm wondering if this should be looked at as part of #16304 - and it does turn out to be 32-bit and 64-bit mismatch (where a 64-bit handle value is truncated on 32-bit executables, then resolving this iss won't be that easy).

Thanks.

@Adriani90
Copy link
Collaborator

Closing as duplicate of #9816 which contains more technical information.

@Adriani90 Adriani90 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
close/duplicate needs-technical-investigation A technical investigation is required to progress the issue. needs-triage p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority
Projects
None yet
Development

No branches or pull requests

6 participants