Suppress duplicate Visual Studio tooltips#11841
Conversation
See test results for failed build of commit b62161a4c8 |
|
Can you expand on how you chose 0.2 seconds? |
| newText = self.name | ||
| newTime = time.time() | ||
| self.__class__._lastToolTipOpenedInfo = (newText, newTime) | ||
| if newText == oldText and oldTime is not None and (newTime - oldTime) < 0.2: |
There was a problem hiding this comment.
I think this really needs a comment to explain why this is done.
For instance, it is probably worth pointing out that a user may intentionally be trying to hear the same tooltip twice, hence the 0.2 seconds. I think the value could be larger (eg 1 second). Given that the text must be equal consecutively, we should look to approach the limit of how rapidly a user could ever intentionally try to trigger the same tooltip twice in a row.
This was by trial and error, I was looking for a small window. I can give a more in depth rationalisation based on logging if you desire.
I was just looking for the smallest window. This was actually mostly copied from the should accept UIA live region code, however there, the interval was 0.5 seconds. I could think of situations where one would rapidly arrow back and forth between IntelliSense items, so my feeling says one second might be too much. |
In this case the |
Not in the following situation:
|
|
Ok, yes that situation needs to be considered too. Could we tie this to input somehow? EG make this longer timeout, but reset when there is keyboard input? |
I'm afraid that's pretty hacky. Not sure whether to register the reset, then. |
|
I don't think there is any other reasonable heuristic we can use to determine whether the tooltip showing is the user's intention. But basing this solely on keyboard input would exclude low-vision mouse users. I think for now we can accept this PR the way it is, hopefully this workaround improves the outcome most of the time. For users on slower computers (or under-load or with different tooltip settings) the timeout may not be appropriate. Perhaps one step better is to make the timeout an advanced configuration. There is a certain argument that problems like this should be left exposed so they are more obvious and get fixed in the 3rd party application (Visual Studio in this case), however we should be able to replicate this issue with accEvent and request a fix from Microsoft. |
Agreed, but it is pretty irritating for daily users.
I will try to contact Dante Gange about this. |
Co-authored-by: Reef Turner <feerrenrut@users.noreply.github.com>
See test results for failed build of commit 3eb7e229d3 |
See test results for failed build of commit 257b3afb43 |
Link to issue number:
Closes #11611
Summary of the issue:
In Visual Studio, the tooltip opened event is fired twice for IntelliSense popups.
Description of how this pull request fixes the issue:
In an overlay class, ignore the event if it was fired less than 0.2 seconds ago and had the same name.
Testing performed:
Tested that tool tips are only announced once.
Known issues with pull request:
None
Change log entry: