question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Arguments tooltip is lost when certain topmost window steals focus

See original GitHub issue

Hi @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:

EXCEL_7gK5ojzvFk

Steps to reproduce:

  1. Follow the “Getting started” guide in https://excel-dna.net/
  2. Add an ExcelArgument attribute to name parameter of SayHello method, e.g.: [ExcelArgument(Name = "Name", Description = "Enter your name")]
  3. Build and run the addin
  4. Load ExcelDna.IntelliSense[64].xll
  5. Focus on a cell and press Windows key and plus sign - Magnifier appears
  6. Close Magnifier (optional)
  7. 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: image

If that works, I could submit a pull request. Otherwise, we would love to hear your advice on this matter.

Issue Analytics

  • State:open
  • Created 9 months ago
  • Reactions:2
  • Comments:17 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
govertcommented, Jul 19, 2023

@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.

1reaction
sshukurovcommented, Jun 14, 2023

@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: image

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prevent JavaFX Tooltip from focusing background stage
Prevent JavaFX Tooltip from focusing background stage ... that I want the background Tooltips to continue to work but just not steal focus....
Read more >
Detect whenever a specified app gains or loses focus
To narrow the problem down, I would try it with just the tooltip and see if it misses a focus change when you...
Read more >
Errors and Warnings window steals keyboard focus during ...
Ideally the Errors and Warnings panel should not receive keyboard focus until the end of the build. Even better, perhaps that panel should...
Read more >
Solved: Calling SetWindowPos(HWND_TOPMOST) on a ...
This is causing a focus defect where upon opening the second dialog, sometimes the first dialog will pop up as the top window...
Read more >
Prevent the window from stealing focus. - Microsoft Q&A
I create a dialog box without a frame, assign the WS_EX_LAYERED style, and move it over the main window within certain boundaries, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found