Arguments tooltip is lost when certain topmost window steals focus
See original GitHub issueHi @govert,
Our team has been struggling with an unpleasant issue when at times the arguments tooltip doesn’t pop up when needed. We tracked it down and created a minimal repro:
Steps to reproduce:
- Follow the “Getting started” guide in https://excel-dna.net/
- Add an ExcelArgument attribute to
name
parameter ofSayHello
method, e.g.:[ExcelArgument(Name = "Name", Description = "Enter your name")]
- Build and run the addin
- Load ExcelDna.IntelliSense[64].xll
- Focus on a cell and press Windows key and plus sign - Magnifier appears
- Close Magnifier (optional)
- Type
=SayHello(
Expected: Arguments tooltip must show up. Actual: It does not show up, closing the Magnifier doesn’t help.
More investigation by our team:
We turned on diagnostic logging and saw that the problem roots in FormulaEditWatcher.cs. It appears that it normally expects events in the following order: Focus
> Show
> Unfocus
> Hide
. In our case however, we saw events in the produced log in Focus
> Unfocus
> Hide
order.
We attempted to add some compensating code to IntelliSense and it helped:
If that works, I could submit a pull request. Otherwise, we would love to hear your advice on this matter.
Issue Analytics
- State:
- Created 9 months ago
- Reactions:2
- Comments:17 (13 by maintainers)
Top GitHub Comments
@sshukurov Your changes should be in 1.7.0-RC6 and from what I can see it works well. Thank you very much for the contribution.
I suppose (to answer the question from @wh1t3cAt1k before) that the ideal solution is to filter the WinEvents stream in native code, and have some mechanism to forward only the important information to the managed code. But the price of adding a native component to the IntelliSense library would be high - for example it would not be compatible with the Excel-DNA packing. One can go down the rabbit hole of have a native component managed from a resource, or making an executable region in data. But it doesn’t seem like the right solution in this case.
I’m happy if we can get to a reliable plan that stays in the managed world, and I think the position-update-after-move behaviour is fine for this case.
@govert this issue had been fixed for us for a while, before it re-surfaced recently with exactly the same symptoms. Closer investigation revealed that the regression happened after the changes made per https://github.com/Excel-DNA/IntelliSense/issues/123.
Our team troubleshooted this and we came to understanding that
EVENT_OBJECT_LOCATIONCHANGE
was necessary for the arguments tooltip to work properly but the event was replaced in the issue mentioned above.We referred to the official docs for the event, where it is said to be triggered for caret and window objects:
That knowledge allowed us to assume we could re-enable the handling of it, only in the context of “caret” objects - to restore the proper behavior of the arguments tooltip, at the same time keeping the fix for https://github.com/Excel-DNA/IntelliSense/issues/123.
We already made the relevant changes in our fork and got approval from our QA team. I’m going to proceed with a pull request to this repo and shall wait for you further feedback.
cc @sbolofsson