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
Don't handle most events from background processes by default #3831
Comments
Comment 1 by jteh on 2014-02-05 06:04 |
Comment 2 by jteh on 2014-02-05 09:29 |
Comment 3 by James Teh <jamie@... on 2014-02-05 09:30
Changes:
|
Comment 6 by Michael Curran <mick@... on 2014-02-07 07:06
|
Comment 7 by James Teh <jamie@... on 2014-02-13 01:31
|
Comment 8 by James Teh <jamie@... on 2014-02-14 05:56
|
Comment 12 by James Teh <jamie@... on 2014-02-22 08:50
|
Comment 13 by camlorn on 2014-02-24 17:11 |
Comment 14 by jteh (in reply to comment 13) on 2014-02-28 22:06
I doubt it's this code, as I'd expect things ot faill constantly rather than after some time. That said, here's a try build with next minus the code for this ticket. If you can't reproduce it while running this build, you would appear to be correct and we've at least isolated the issue. If you can, we'll need to look elsewhere. |
Comment 15 by nvdakor on 2014-03-01 03:31 |
Comment 17 by James Teh <jamie@... on 2014-03-04 03:51
|
Comment 20 by James Teh <jamie@... on 2014-06-24 06:34
|
Comment 21 by jteh (in reply to comment 15) on 2014-06-24 06:42
As an aside, it's worth noting that this generally shouldn't be done unless a sighted user would get equivalent background notification.
Can you be more specific about what events splstudio needs? For example, do you know the window class name from which you would need events and do you know exactly what events you need? In the API I'm considering, there would be an eventHandler.requestEvents function that takes eventName, processId and windowClassName. The question is whether windowClassName needs to be optional. I'd prefer that it weren't optional, but if there are already cases where the window class name is very dynamic, it might have to be optional. |
Comment 22 by nvdakor (in reply to comment 21) on 2014-06-24 11:57
Hi, |
Comment 23 by nvdakor on 2014-06-24 18:15
|
Comment 25 by leonarddr on 2014-06-27 15:17 |
Comment 26 by James Teh <jamie@... on 2014-08-08 13:04
|
Comment 28 by James Teh <jamie@... on 2015-01-23 07:53
|
Comment 29 by James Teh <jamie@... on 2015-01-29 07:02
|
Comment 30 by jteh (in reply to comment 23) on 2015-01-29 07:04
Should be fixed in latest next. At least, it works for me now. |
Comment 31 by James Teh <jamie@... on 2015-02-03 07:22
|
Comment 32 by jteh (in reply to comment 15) on 2015-02-03 07:25
I've just added an eventHandler.requestEvents function to cover this. Could you please test it with splstudio and ensure whether it does what you need? Btw, once this graduates, you can use hasattr or check for AttributeError in order to support versions of NVDA without this if you need to support both. |
Comment 33 by nvdakor (in reply to comment 32) on 2015-02-03 09:37
Tested with Studio and it works.
|
Comment 34 by nvdakor on 2015-02-03 12:39
|
Comment 35 by jteh on 2015-02-03 21:18 |
Comment 36 by James Teh <jamie@... on 2015-02-04 00:14
|
Comment 37 by jteh (in reply to comment 33) on 2015-04-08 05:48
How often? Are you certain this isn't the case without this branch (e.g. in master)?
That makes sense. event_NVDAObject_init is only called when NVDA creates the object; e.g. if an event is fired on it or the user navigates to it. However, if you haven't yet requested events, the event won't be received, so the object will never be created and thus event_NVDAObject_init will never be called. In short, yes, you should generally request events when your plugin is instantiated. |
Comment 38 by nvdakor (in reply to comment 37) on 2015-04-08 16:01
I believe this isn't with master. This is a minor thing that doesn't affect the app module usage. |
Comment 39 by jteh (in reply to comment 34) on 2015-04-09 03:47
Fixed in aa63df3. |
Comment 40 by James Teh <jamie@... on 2015-04-09 03:52
|
Comment 41 by nvdakor on 2015-04-14 02:26
|
Comment 42 by jteh on 2015-04-14 02:34 |
Comment 43 by James Teh <jamie@... on 2015-07-01 12:05
|
Comment 44 by jteh (in reply to comment 41) on 2015-07-01 12:07
Joseph, can you please test this now with latest next? The new code seems to work for me. |
Comment 45 by nvdakor on 2015-07-01 17:02 |
Comment 46 by nvdakor on 2015-07-02 16:43
Is the pid of the closed app automatically removed from accept events set? Sounds like this is what's happening: event handler attempts to remove a pid that no longer exists. I'm thinking of catching key error and moving on. |
Comment 47 by James Teh <jamie@... on 2015-07-03 00:29
|
Comment 48 by James Teh <jamie@... on 2015-07-20 07:40
Changes:
|
Comment 49 by jteh on 2015-07-20 07:43 |
…t application, NVDA is now much more responsive in other applications in most cases. This is done by filtering out events from background windows in most cases to avoid freezes when a background app is unresponsive. One hard-coded exception is when background progress bar reporting is enabled, in which case background valueChange events are allowed. To facilitate this, eventHandler.shouldAcceptEvent was introduced. eventHandler.requestEvents was also added to request particular events that are blocked by default; e.g. show events from a specific control or certain events even when in the background. Fixes #3831.
Reported by jteh on 2014-01-31 07:25
We do filter some events (e.g. MSAA show events are restricted to certain window classes), but for the most part, we unconditionally handle all events we listen for. This can lead to poor performance if an unresponsive (or very slow to respond) background application fires an event. One example is an application performing some task while displaying a progress bar, but the task blocks the GUI for long periods of time. Even if you switch to another app and have reporting of background progress bars disabled, NVDA will freeze for long periods in this situation. To work around this, we should stop handling most events from background processes by default. Because some code might need background events, we should provide a mechanism to request specific events for specific processes.
Blocked by #3849, #3850, #3897, #3899, #3905, #4001
Blocking #3964
The text was updated successfully, but these errors were encountered: