-
Notifications
You must be signed in to change notification settings - Fork 52
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
Arguments tooltip is lost when certain topmost window steals focus #124
Comments
The sporadic missing tooltip window issue reproes quite stably for several members of our company (all with multi-screen setups), albeit not using the screen magnifier, but in their logs, the sequence of events is the same. It's been occurring more frequently recently than before, which might be related to a recent Excel update. |
On my side, the issue is especially obvious when doing a demo of our product on a Zoom/Teams call. Both products have some sort of top-most window/UI that may be interferring with focus the same way @sshukurov is able to with the Magnifier. |
Hi @sshukurov - Yes, I can reproduce this too. All of the state tracking for the windows is just derived from what I could see happening, so I'm not surprised there are scenarios where it goes wrong. A pull request would be very welcome. Do you understand why your suggested change would fix the event scenario Focus -> Unfocus -> Hide, since we don't do currently do anything in Show or Hide anyway? |
… topmost window steals focus
I know why it fixes, yes it was hard to debug and I was able to get some understanding only through studying the logs. In
Consequently in
So in What I don't actually understand is why the need for |
@govert one of my colleages informed me today that the arguments tooltip gets hidden even with my proposed fix with a slight change to the above steps:
Magnifier must be kept open to be able to reproduce this one. Surface investigation revealed that the tooltip gets hidden here because of My first thought as a potential remedy was to change I'm slightly afraid, however, that this change might break existing functionality. I'm completely unaware for example, whether those events trigger in the same manner in different versions of OS and/or Excel 🤔 |
@govert we're merging @sshukurov 's changeset into our fork of IntelliSense, including his last screenshot... Please let us know if you have any reservations or concerns about it |
@wh1t3cAt1k No, I have no particular concerns with using only @sshukurov You said:
I don't recall the details, but I presume I added cases to allow logging of any event that might be useful, then tried to use the logging to figure out a good pair to do the tracking. I have no insight about other Windows or Excel versions. |
…rth and back with ALT + TAB
…ltip-lost-when-topmost-window-steals-focus #124 Fix case when arguments tooltip is not displayed when a topmost window steals focus
@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 #123. Our team troubleshooted this and we came to understanding that 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 #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 |
…ng issue by re-enabling LOCATIONCHANGE event but only when fired for the caret
…ltip-regression #124 Troubleshoot IntelliSense arguments tooltip not appearing issue …
…g issue by re-enabling LOCATIONCHANGE event but only when fired for the caret" This reverts commit 62d1811.
Hi @sshukurov - I tried the pull request #130, but had to revert it again :-( With those changes I get back to the very laggy window movement of #123 (whether some IntelliSense pop-up is showing or not). I suspect that the moment we register to getting the extra WinEvent events, the native-> managed transitions are overwhelming (given the message processing changes that we think was made in some recent Excel version). I don't know how your private branch is performing - is your window dragging OK? |
@govert as @sshukurov mentioned, we discovered that subscribing to location change at least for the caret was critical because otherwise the IntelliSense argument tooltip was sometimes not appearing while the user entered the formula in-cell. At the same time, we can confirm that it returned the laggy behaviour. We have three questions:
Because here there is no hwnd filter:
Maybe we could subscribe to location change in a separate call and pass the hwnd of the "most granular thing" closest / most relevant to the caret? Any ideas how to obtain it?
|
Another thought @sshukurov @govert , if the issue could be related to the fact that the event handler runs on Excel's main thread (on the off chance it's not native/managed transition that is lagging). Perhaps one thing that could be tried is to subscribe to EVENT_LOCATION_CHANGE (only this event) on a dedicated non-main thread and see if it helps? |
…again upon MOVESIZEEND
Hi Govert! I spent a while trying to implement what was proposed by @wh1t3cAt1k:
Unfortunately I wasn't able to arrive at a working solution - I was getting a successful hook registration but apparently So instead I decided to try a workaround where we would unhook from Again, our QA team verified the workaround against this issue as well as #123, so I proceeded to submitting a PR for your review and testing: Thank you! |
Govert, please hold on reviewing, we are seeing some inconsistent behavior with my latest changes. I'll get back here as soon as I have an update. |
@govert I updated the PR - I moved the hooking/unhooking of Our team carefully tested the changes this time - no window lagging and no issues with IntelliSense so far. Please consider on your end. |
@sshukurov Your changes should be in 1.7.0-RC6 and from what I can see it works well. 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. |
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:
Steps to reproduce:
name
parameter ofSayHello
method, e.g.:[ExcelArgument(Name = "Name", Description = "Enter your name")]
=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 inFocus
>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.
The text was updated successfully, but these errors were encountered: