dotnet / dotnet/wpf

WPF ToolTip PlacementMode Mouse does not use scaled mouse cursor bounding box nor dpi scaling

Open
#6,596 0 comments 0 reactions 1 assignee Claimed by @singhashish-wpf View on GitHub
area-Tooltip Investigate
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

* .NET Core Version: (e.g. 3.0 Preview1, or daily build number, use `dotnet --info`)
```
.NET SDK (reflecting any global.json):
Version: 6.0.300
Commit: 8473146e7d

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19044
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.300\

Host (useful for support):
Version: 6.0.5
Commit: 70ae3df4a6

.NET SDKs installed:
5.0.408 [C:\Program Files\dotnet\sdk]
6.0.300 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
```
* Windows version: (`winver`)
Version 21H2 (OS Build 19044.1706)
* Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes/No
.NET Framework 4.8 does show a different behavior:
![image](https://user-images.githubusercontent.com/2128945/168967376-c8b2beb2-e50c-408c-87dd-224d3acaa0ad.png)
(This is without mouse cursor scaling on 150% dpi scaling)

* Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? If yes, please file the issue via the instructions [here](https://docs.microsoft.com/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2019).
* Security issues and bugs should be reported privately, learn more via our [responsible disclosure guidelines](https://github.com/dotnet/wpf/blob/main/README.md#reporting-security-issues-and-security-bugs).



**Problem description:**
A tooltip with `Placement` set to `PlacementMode.Mouse` will appear below the mouse point.
So far so good.
But on high dpi displays with scaling > 1 it does not adhere to the actual mouse cursor bounding box.
![image](https://user-images.githubusercontent.com/2128945/168967969-3c7a8004-470f-43e5-81e7-8abc8186a1ee.png)

Nor does it adhere to a scaled mouse cursor (can't show an image, since neither irfanview or hypersnap do use the scaled mouse cursor, you just have to try it for yourself)

**Actual behavior:**
![image](https://user-images.githubusercontent.com/2128945/168967984-d87aa57c-aac4-4622-b533-2849d0a855fe.png)

**Expected behavior:**
Tooltip placement mode `Mouse` should adhere to dpi and mouse scaling to prevent overlapping and thus unreadable tooltip beginning

**Minimal repro:**
```



<Setter Property="Placement" Value="Mouse"/>








```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.