-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Tooltip Direct Manipulation Fix #7333
Conversation
I can provide you with one real world example to run your code against
The tooltip code is:
I've yet to reproduce the exception reported in #6319 |
@dipeshmsft do you still need a repro for testing? I was able to repro this issue reliably while developing a new feature for one of my apps, which targets .NET 7. |
Any way we can finalize this PR in the close future? The tooltip issue exists for like a year now. |
@amaitland, thanks for the repro steps. I will test the fix against it. However, I just wanted to clarify about the comment that, we know some ways how direct tooltip manipulation is causing the crashes ( and the fix is based on that ), but there can be more ways which may not be covered with this fix. @batzen, it will be good to verify the fix against one more crashing scenario. What are the repro steps in your case ? |
Hi @batzen, do you have reproduction steps you could share to reconstruct this bug? It seems like the progress for this bugfix stagnated again and we are uncertain that this fix will make it into the February service pack release. And since we receive crash reports on a daily basis for this issue from our customers, we want to look into work arounds to prevent the crashes in the first place, if this is not being fixed in the framework itself in the foreseeable future. Just as side note, in our case the crashes seem to occur comparably often in combination with external tools for doing things like screenshots or screen recordings, so the tooltip manipulation might be triggered externally. So, we would very appreciate if you could share any reproduction steps, so we can look into this. :) |
Uh. Sorry. Totally missed the notification. |
Attached is the project to reproduce the issue. |
@czdietrich, I forgot to update the status of the issue. In our test pass the original fix was failing. I have made some changes and will be rerunning the test pass. |
Hi @batzen, thank you for the reproduction steps, this was very helpful. It took me some time to master it, but after a decent amount of time, I am now able to mime your mouse movements to cause the crash. If someone just looks for a simple (and dirty) workaround until it is fixed in the framework itself, this exception can be handled and ignored by simply adding something like this to the startup code: Dispatcher.UnhandledException += (object sender, DispatcherUnhandledExceptionEventArgs e) =>
{
if (e.Exception is ArgumentNullException && e.Exception.StackTrace?.Contains("ToolTipService.GetBetweenShowDelay") == true)
{
e.Handled = true;
return;
}
}; |
@dipeshmsft To clarify I've not been able to reproduce the error myself, there are plenty of reports though in the context of The callstack is essentially the same as #7002 (mouse down triggers a capture which closes the tooltip). Have you been able to validate your fix against the demo provided in #7002? If yes then I'd be hopeful that the issue would be resolved. |
@amaitland, yes I have verified the fix against the demo provided in #7002 .
I did not try clicking the mouse yet. I will take a look at it again and get back to you. |
Great. To me the callstacks look almost identical, so I'd be hopeful the same fix applies.
Unfortunately I don't have a clear set of instructions for you. I've spent hours and have yet to reproduce the problem myself. The |
Fixes #
#6319 #7002
Main PR
Description
When an app opens the tooltip directly, WPF ( independently ) also activates the tooltip ( marks it 'current; , registers handlers for Opened and Closed events , sets some internal properties and opens the tooltip ). Now, when app closes the tooltip directly, the closed event is raised.
Now, when the app re-opens the tooltip, WPF decides to dismiss the 'current' tooltip and while doing so, it uses the internal properties, which were unset by the closed event. Thus resulting in the error
In this fix,
Customer Impact
Apps that do direct manipulation of tooltips can crash when run on .NET 6.0+
Regression
Yes, fixes compat regression
Testing
Test pass in progress , Ad-Hoc Testing with sample apps.
Risk
We don't know which real apps/libraries do direct manipulation of tooltips, how they do it, or how they interact with the built-in tooltip management. The examples we have seen some different ways of managing tooltips. And there may be cases that are still not handled with the fix.
Microsoft Reviewers: Open in CodeFlow